Class: SysLogger
- Inherits:
-
Object
- Object
- SysLogger
- Defined in:
- lib/sys_logger.rb
Overview
Logs using the syslog facility.
Instance Method Summary collapse
- #alert(msg) ⇒ Object
- #close ⇒ Object
- #crit(msg) ⇒ Object
- #debug(msg) ⇒ Object
- #emerg(msg) ⇒ Object
- #err(msg) ⇒ Object (also: #error)
- #info(msg) ⇒ Object
-
#initialize(dummy, program_name) ⇒ SysLogger
constructor
A new instance of SysLogger.
- #notice(msg) ⇒ Object
- #puts(msg) ⇒ Object
- #warning(msg) ⇒ Object
Constructor Details
#initialize(dummy, program_name) ⇒ SysLogger
Returns a new instance of SysLogger.
5 6 7 |
# File 'lib/sys_logger.rb', line 5 def initialize(dummy, program_name) @log = Syslog.open(program_name) end |
Instance Method Details
#alert(msg) ⇒ Object
29 30 31 |
# File 'lib/sys_logger.rb', line 29 def alert(msg) @log.alert(msg) end |
#close ⇒ Object
9 10 |
# File 'lib/sys_logger.rb', line 9 def close end |
#crit(msg) ⇒ Object
35 36 37 |
# File 'lib/sys_logger.rb', line 35 def crit(msg) @log.crit(msg) end |
#debug(msg) ⇒ Object
14 15 16 |
# File 'lib/sys_logger.rb', line 14 def debug(msg) @log.debug(msg) end |
#emerg(msg) ⇒ Object
32 33 34 |
# File 'lib/sys_logger.rb', line 32 def emerg(msg) @log.emerg(msg) end |
#err(msg) ⇒ Object Also known as: error
26 27 28 |
# File 'lib/sys_logger.rb', line 26 def err(msg) @log.err(msg) end |
#info(msg) ⇒ Object
17 18 19 |
# File 'lib/sys_logger.rb', line 17 def info(msg) @log.info(msg) end |
#notice(msg) ⇒ Object
20 21 22 |
# File 'lib/sys_logger.rb', line 20 def notice(msg) @log.notice(msg) end |
#puts(msg) ⇒ Object
11 12 13 |
# File 'lib/sys_logger.rb', line 11 def puts(msg) @log.info(msg) end |
#warning(msg) ⇒ Object
23 24 25 |
# File 'lib/sys_logger.rb', line 23 def warning(msg) @log.warning(msg) end |