lib/ztk/logger.rb in ztk-3.1.0 vs lib/ztk/logger.rb in ztk-3.2.0

- old
+ new

@@ -13,38 +13,42 @@ # You can chain multiple loggers together, for example to get an effect of # logging to STDOUT and a file simultaneously without having to modify your # existing logging statements. # # One can override the logging level on the command line with programs that - # use this library like so: - # LOG_LEVEL=DEBUG bin/cucumber-chef ssh + # use this library by defining the *LOG_LEVEL* environment variable to the + # desired logging level. # - # *Typical usage*: + # @example Override the logging level at runtime # + # LOG_LEVEL=DEBUG bin/a_ruby_script.rb + # + # @example Typical usage + # # $logger = ZTK::Logger.new("/dev/null") # # $logger.debug { "This is a debug message!" } # $logger.info { "This is a info message!" } # $logger.warn { "This is a warn message!" } # $logger.error { "This is a error message!" } # $logger.fatal { "This is a fatal message!" } # - # *Simple logger chain*: + # @example Simple logger chaining # # logger = ZTK::Logger.new # logger.loggers << ::Logger.new(STDOUT) # logger.loggers << ::Logger.new('test.log') # # logger.debug { "This will be written to STDOUT as well as test.log!" } # - # *Alternate logger chaining*: + # @example Simple logger chaining # # logger = ZTK::Logger.new(STDOUT) # logger.loggers << ::Logger.new('test.log') # # logger.debug { "This will be written to STDOUT as well as test.log!" } # - # @author Zachary Patten <zachary AT jovelabs DOT com> + # @author Zachary Patten <zpatten AT jovelabs DOT io> class Logger < ::Logger # Log Levels SEVERITIES = Severity.constants.inject([]) {|arr,c| arr[Severity.const_get(c)] = c; arr}