Class: PuppetTwitch::Logger
- Inherits:
-
Object
- Object
- PuppetTwitch::Logger
- Defined in:
- lib/puppet_twitch/logger.rb
Overview
Logger just prints to STDOUT. When the server is running in the foreground (not Daemonized), all output is visible in the terminal. When the server is running as a Daemon, STDOUT is redirected to a logfile, so this simple logger works for both scenarios
Constant Summary collapse
- DEBUG =
0
- INFO =
1
- WARN =
2
- ERROR =
3
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(level = INFO) ⇒ Logger
constructor
A new instance of Logger.
- #warn(message) ⇒ Object
Constructor Details
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
17 18 19 |
# File 'lib/puppet_twitch/logger.rb', line 17 def level @level end |
Instance Method Details
#debug(message) ⇒ Object
23 24 25 |
# File 'lib/puppet_twitch/logger.rb', line 23 def debug() log DEBUG, "Log [DEBUG]: #{}" end |
#error(message) ⇒ Object
32 33 34 |
# File 'lib/puppet_twitch/logger.rb', line 32 def error() log ERROR, "Log [ERROR]: #{}" end |
#info(message) ⇒ Object
26 27 28 |
# File 'lib/puppet_twitch/logger.rb', line 26 def info() log INFO, "Log [INFO]: #{}" end |
#warn(message) ⇒ Object
29 30 31 |
# File 'lib/puppet_twitch/logger.rb', line 29 def warn() log WARN, "Log [WARN]: #{}" end |