lib/timber/logger.rb in timber-2.0.7 vs lib/timber/logger.rb in timber-2.0.8
- old
+ new
@@ -210,9 +210,15 @@
end
super
end
+ # Convenience method for adding context. Please see {{Timber::CurrentContext.with}} for
+ # a more detailed description and examples.
+ def with_context(context, &block)
+ Timber::CurrentContext.with(context, &block)
+ end
+
# Backwards compatibility with older ActiveSupport::Logger versions
Logger::Severity.constants.each do |severity|
class_eval(<<-EOT, __FILE__, __LINE__ + 1)
def #{severity.downcase}(*args, &block)
progname = args.first
\ No newline at end of file