lib/lager.rb in lager-1.1.0.1 vs lib/lager.rb in lager-1.1.2.1
- old
+ new
@@ -13,13 +13,10 @@
#
# def self.foo
# @lager.debug { "example log message" }
# end
#
-# Note that using the block invocation means that the block contents are
-# not evaluated if the log level is above the message level.
-#
# Make sure to call log_to within the class definition, so that class methods
# will already have @lager defined at requiretime.
#
# For instance methods, you need to set @lager directly, within initialize
# Note: the instance layer and class layer each have their own independent
@@ -28,16 +25,10 @@
#
# def initialize
# @lager = self.class.lager
# end
#
-# Outside of initialize or a call to log_to within the class definition,
-# you should only ever call the message methods: debug, info, warn, error,
-# and fatal within your class code.
-#
-# Let the destination and log level be managed from outside.
-#
module Lager
def self.version
file = File.expand_path('../../VERSION', __FILE__)
File.read(file).chomp
end
@@ -57,10 +48,10 @@
line = "[#{time.strftime('%Y-%m-%d %H:%M:%S')}]"
line << sev.to_s.upcase.rjust(5) << ":"
line << "(#{progname})" if progname
line << " #{msg}\n"
}
- log_level = level
+ self.log_level = level
dest # don't expose @lager here
end
# call without argument to get the log level
# call with argument to set the log level