diff options
author | sonots <sonots@gmail.com> | 2019-03-22 01:14:14 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-12-09 19:17:31 +0900 |
commit | 0aafc32995b935b6c46c8439a3e2da008cd683fc (patch) | |
tree | e672890608cb0a2f5a26855823e6f36de0c494c3 /lib/logger | |
parent | 22548195d59d8b5e421c586bec81615a0a1091bc (diff) | |
download | ruby-0aafc32995b935b6c46c8439a3e2da008cd683fc.tar.gz |
[ruby/logger] frozen_string_literal: true
https://github.com/ruby/logger/commit/a057eede7b
Diffstat (limited to 'lib/logger')
-rw-r--r-- | lib/logger/errors.rb | 2 | ||||
-rw-r--r-- | lib/logger/formatter.rb | 9 | ||||
-rw-r--r-- | lib/logger/log_device.rb | 2 | ||||
-rw-r--r-- | lib/logger/period.rb | 2 | ||||
-rw-r--r-- | lib/logger/severity.rb | 2 |
5 files changed, 13 insertions, 4 deletions
diff --git a/lib/logger/errors.rb b/lib/logger/errors.rb index 8095acc9c8..e8925e14ac 100644 --- a/lib/logger/errors.rb +++ b/lib/logger/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # not used after 1.2.7. just for compat. class Logger class Error < RuntimeError # :nodoc: diff --git a/lib/logger/formatter.rb b/lib/logger/formatter.rb index 13cb1a8390..206c35d9fa 100644 --- a/lib/logger/formatter.rb +++ b/lib/logger/formatter.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + class Logger # Default formatter for log messages. class Formatter - Format = "%s, [%s#%d] %5s -- %s: %s\n".freeze + Format = "%s, [%s#%d] %5s -- %s: %s\n" attr_accessor :datetime_format @@ -17,7 +19,7 @@ class Logger private def format_datetime(time) - time.strftime(@datetime_format || "%Y-%m-%dT%H:%M:%S.%6N ".freeze) + time.strftime(@datetime_format || "%Y-%m-%dT%H:%M:%S.%6N ") end def msg2str(msg) @@ -25,8 +27,7 @@ class Logger when ::String msg when ::Exception - "#{ msg.message } (#{ msg.class })\n" << - (msg.backtrace || []).join("\n") + "#{ msg.message } (#{ msg.class })\n#{ (msg.backtrace || []).join("\n") }" else msg.inspect end diff --git a/lib/logger/log_device.rb b/lib/logger/log_device.rb index 5661f5ce14..fe7d54fb81 100644 --- a/lib/logger/log_device.rb +++ b/lib/logger/log_device.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'period' class Logger diff --git a/lib/logger/period.rb b/lib/logger/period.rb index bb8cffc2f8..76a8c3b011 100644 --- a/lib/logger/period.rb +++ b/lib/logger/period.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Logger module Period module_function diff --git a/lib/logger/severity.rb b/lib/logger/severity.rb index c8179cb017..b38afb7d22 100644 --- a/lib/logger/severity.rb +++ b/lib/logger/severity.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Logger # Logging severity. module Severity |