Class: ActiveRdfLogger
- Inherits:
-
Object
- Object
- ActiveRdfLogger
- Defined in:
- lib/active_rdf_log.rb
Class Method Summary collapse
-
.log_add(message = nil, severity = Logger::DEBUG, context = nil) ⇒ Object
Logs a message of the given severity.
-
.logger ⇒ Object
Get the logger for the ActiveRDF library.
-
.logger=(logger) ⇒ Object
Assign a new logger.
Class Method Details
.log_add(message = nil, severity = Logger::DEBUG, context = nil) ⇒ Object
Logs a message of the given severity. The context may identify the class/ object that logged the message
37 38 39 40 41 42 |
# File 'lib/active_rdf_log.rb', line 37 def log_add( = nil, severity = Logger::DEBUG, context = nil) logger.add(severity, nil, "ActiveRDF") do = yield if(! && block_given?) (, context) end end |
.logger ⇒ Object
Get the logger for the ActiveRDF library. This will default to the Rails logger if that is active. Otherwise it will use the configured logger for ActiveRDF. (Note that some messages may go to the configured logger if ActiveRDF is initialized before Rails).
24 25 26 |
# File 'lib/active_rdf_log.rb', line 24 def logger @logger ||= get_active_rdf_logger end |
.logger=(logger) ⇒ Object
Assign a new logger
29 30 31 32 33 |
# File 'lib/active_rdf_log.rb', line 29 def logger=(logger) raise(ArgumentError, "Empty Logger") if(logger == nil) @logger = logger @native_logger = false end |