lib/semantic_logger/formatters/base.rb in semantic_logger-4.2.0 vs lib/semantic_logger/formatters/base.rb in semantic_logger-4.2.1
- old
+ new
@@ -6,20 +6,20 @@
# Time precision varies by Ruby interpreter
# JRuby 9.1.8.0 supports microseconds
PRECISION =
if defined?(JRuby)
- if (JRUBY_VERSION.to_f >= 9.1)
+ if JRUBY_VERSION.to_f >= 9.1
maint = JRUBY_VERSION.match(/\A\d+\.\d+\.(\d+)\./)[1].to_i
(maint >= 8) || (JRUBY_VERSION.to_f > 9.1) ? 6 : 3
else
3
end
else
6
end
- TIME_FORMAT = "%Y-%m-%d %H:%M:%S.%#{PRECISION}N"
+ TIME_FORMAT = "%Y-%m-%d %H:%M:%S.%#{PRECISION}N".freeze
# Parameters
# time_format: [String|Symbol|nil]
# See Time#strftime for the format of this string.
# :iso_8601 Outputs an ISO8601 Formatted timestamp.
@@ -54,9 +54,8 @@
''
else
time.strftime(time_format)
end
end
-
end
end
end