lib/timber/logger.rb in timber-2.0.2 vs lib/timber/logger.rb in timber-2.0.3

- old
+ new

@@ -164,14 +164,15 @@ def call(severity, time, progname, msg) build_log_entry(severity, time, progname, msg) end end - class << self - def new_from_config - end - end + # These are rails modules that change the logger behavior. We have to + # include these if they are present or the logger will not function properly + # in a rails environment. + include ::ActiveSupport::LoggerThreadSafeLevel if defined?(::ActiveSupport::LoggerThreadSafeLevel) + include ::LoggerSilence if defined?(::LoggerSilence) # Creates a new Timber::Logger instances. Accepts the same arguments as `::Logger.new`. # The only difference is that it default the formatter to {HybridFormatter}. Using # a different formatter is easy. For example, if you prefer your logs in JSON. # @@ -191,9 +192,11 @@ else self.formatter = HybridFormatter.new end self.level = environment_level + + after_initialize if respond_to? :after_initialize @initialized = true end def formatter=(value) \ No newline at end of file