Class: Notarius::Secretary
- Inherits:
-
Object
- Object
- Notarius::Secretary
- Defined in:
- lib/notarius/secretary.rb
Overview
Provides an API for logging modules.
Instance Method Summary collapse
-
#configure(config) ⇒ void
Configures a Secretary.
-
#error(message) ⇒ void
Logs an error message.
-
#info(message) ⇒ void
Logs an informative message.
-
#initialize ⇒ Secretary
constructor
Creates a new instance of a Secretary.
-
#warn(message) ⇒ void
Logs a warning message.
Constructor Details
#initialize ⇒ Secretary
Creates a new instance of a Secretary.
13 14 15 16 |
# File 'lib/notarius/secretary.rb', line 13 def initialize @loggers = {} = {} end |
Instance Method Details
#configure(config) ⇒ void
This method returns an undefined value.
Configures a Secretary.
23 24 25 26 |
# File 'lib/notarius/secretary.rb', line 23 def configure config update :console, config.console, $stdout update :file, config.file end |
#error(message) ⇒ void
This method returns an undefined value.
Logs an error message. Error messages show up in the log with “ERROR” at the start of the line.
54 55 56 |
# File 'lib/notarius/secretary.rb', line 54 def error log Logger::ERROR, end |
#info(message) ⇒ void
This method returns an undefined value.
Logs an informative message. Informative messages show up the log with “INFO” at the start of the line.
34 35 36 |
# File 'lib/notarius/secretary.rb', line 34 def info log Logger::INFO, end |
#warn(message) ⇒ void
This method returns an undefined value.
Logs a warning message. Warning messages show up in the log with “WARN” at the start of the line.
44 45 46 |
# File 'lib/notarius/secretary.rb', line 44 def warn log Logger::WARN, end |