Class: KStor::Log::SimpleLogger Private
- Inherits:
-
Object
- Object
- KStor::Log::SimpleLogger
- Defined in:
- lib/kstor/log/simple_logger.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Simple logger using Ruby Logger.
It just defines some convenient methods that Journald::Logger has.
Instance Method Summary collapse
-
#debug(msg) ⇒ Object
private
Log a debug message.
-
#error(msg) ⇒ Object
(also: #critical, #alert, #emergency)
private
Log an error message.
-
#exception(exc) ⇒ Object
private
Log an exception with full backtrace and all.
-
#info(msg) ⇒ Object
(also: #notice)
private
Log an informative message.
-
#initialize ⇒ KStor::Log::SimpleLogger
constructor
private
Create a new logger.
-
#level=(lvl) ⇒ Object
private
Set minimum log level.
-
#warn(msg) ⇒ Object
private
Log a warning.
Constructor Details
#initialize ⇒ KStor::Log::SimpleLogger
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new logger.
19 20 21 |
# File 'lib/kstor/log/simple_logger.rb', line 19 def initialize @logger = Logger.new($stdout) end |
Instance Method Details
#debug(msg) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log a debug message.
33 34 35 |
# File 'lib/kstor/log/simple_logger.rb', line 33 def debug(msg) @logger.debug(msg) end |
#error(msg) ⇒ Object Also known as: critical, alert, emergency
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log an error message.
54 55 56 |
# File 'lib/kstor/log/simple_logger.rb', line 54 def error(msg) @logger.error(msg) end |
#exception(exc) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log an exception with full backtrace and all.
61 62 63 |
# File 'lib/kstor/log/simple_logger.rb', line 61 def exception(exc) @logger.error(exc.) end |
#info(msg) ⇒ Object Also known as: notice
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log an informative message.
40 41 42 |
# File 'lib/kstor/log/simple_logger.rb', line 40 def info(msg) @logger.info(msg) end |
#level=(lvl) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set minimum log level
26 27 28 |
# File 'lib/kstor/log/simple_logger.rb', line 26 def level=(lvl) @logger.level = lvl end |
#warn(msg) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Log a warning.
47 48 49 |
# File 'lib/kstor/log/simple_logger.rb', line 47 def warn(msg) @logger.warn(msg) end |