Method: SemanticLogger::Logger#initialize
- Defined in:
- lib/semantic_logger/logger.rb
#initialize(klass, level = nil, filter = nil) ⇒ Logger
Returns a Logger instance
Return the logger for a specific class, supports class specific log levels
logger = SemanticLogger::Logger.new(self)
OR
logger = SemanticLogger::Logger.new('MyClass')
Parameters:
klass
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.default_level
filter [Regexp|Proc]
RegExp: Only include log where the class name matches the supplied
regular expression. All other will be ignored
Proc: Only include log where the supplied Proc returns true
The Proc must return true or false
59 60 61 |
# File 'lib/semantic_logger/logger.rb', line 59 def initialize(klass, level = nil, filter = nil) super(klass, level, filter) end |