Class: Rootage::Logger
- Inherits:
-
Object
- Object
- Rootage::Logger
- Defined in:
- lib/rootage/log.rb
Overview
Logger
is a interface for system logger implementations.
Direct Known Subclasses
Pione::Log::BasicLogger, NullLogger, RubyStandardLogger, SyslogLogger
Class Method Summary collapse
-
.of(type) ⇒ Object
Return logger class of the type.
-
.register(type, logger_class) ⇒ Object
Register the logger class with the type.
Instance Method Summary collapse
-
#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the debug message.
-
#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the error message.
-
#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the fatal message.
-
#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the info message.
-
#level ⇒ Object
Return the log level.
-
#level=(level) ⇒ Object
Set the log level.
-
#queued? ⇒ Boolean
Return true if some messages are queued.
-
#terminate ⇒ Object
Terminate the logger.
-
#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the warn message.
Class Method Details
.of(type) ⇒ Object
Return logger class of the type.
54 55 56 |
# File 'lib/rootage/log.rb', line 54 def self.of(type) @logger[type] end |
.register(type, logger_class) ⇒ Object
Register the logger class with the type.
59 60 61 |
# File 'lib/rootage/log.rb', line 59 def self.register(type, logger_class) @logger[type] = logger_class end |
Instance Method Details
#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the debug message.
94 95 96 |
# File 'lib/rootage/log.rb', line 94 def debug(msg, pos=caller(1).first, pid=Process.pid) raise NotImplementedError end |
#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the error message.
79 80 81 |
# File 'lib/rootage/log.rb', line 79 def error(msg, pos=caller(1).first, pid=Process.pid) raise NotImplementedError end |
#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the fatal message.
74 75 76 |
# File 'lib/rootage/log.rb', line 74 def fatal(msg, pos=caller(1).first, pid=Process.pid) raise NotImplementedError end |
#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the info message.
89 90 91 |
# File 'lib/rootage/log.rb', line 89 def info(msg, pos=caller(1).first, pid=Process.pid) raise NotImplementedError end |
#level ⇒ Object
Return the log level.
64 65 66 |
# File 'lib/rootage/log.rb', line 64 def level raise NotImplementedError end |
#level=(level) ⇒ Object
Set the log level.
69 70 71 |
# File 'lib/rootage/log.rb', line 69 def level=(level) raise NotImplementedError end |
#queued? ⇒ Boolean
Return true if some messages are queued.
104 105 106 |
# File 'lib/rootage/log.rb', line 104 def queued? raise NotImplementedError end |
#terminate ⇒ Object
Terminate the logger.
99 100 101 |
# File 'lib/rootage/log.rb', line 99 def terminate raise NotImplementedError end |
#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object
Log the warn message.
84 85 86 |
# File 'lib/rootage/log.rb', line 84 def warn(msg, pos=caller(1).first, pid=Process.pid) raise NotImplementedError end |