lib/semantic_logger/logger.rb in semantic_logger-0.6.2 vs lib/semantic_logger/logger.rb in semantic_logger-0.7.0
- old
+ new
@@ -1,5 +1,8 @@
+require 'thread'
+require 'sync_attr'
+
# Logger is the interface used by
#
# Logger maintains the logging name to be used for all log entries generated
# by the invoking classes or modules
#
@@ -61,16 +64,20 @@
# logger = SemanticLogger::Logger.new(self)
# OR
# logger = SemanticLogger::Logger.new('MyClass')
#
# Parameters:
- # application: A class, module or a string with the application/class name
- # to be used in the logger
- # options:
- # :level The initial log level to start with for this logger instance
- def initialize(klass, level=self.class.default_level)
+ # application
+ # A class, module or a string with the application/class name
+ # to be used in the logger
+ #
+ # level
+ # The initial log level to start with for this logger instance
+ # Default: SemanticLogger::Logger.default_level
+ #
+ def initialize(klass, level=nil)
@name = klass.is_a?(String) ? klass : klass.name
- self.level = level
+ self.level = level || self.class.default_level
end
# Returns [Integer] the number of log entries that have not been written
# to the appenders
#