Class: Repub::App::Logger::Logger
- Includes:
- Singleton
- Defined in:
- lib/repub/app/logger.rb
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
20 21 22 |
# File 'lib/repub/app/logger.rb', line 20 def level @level end |
#stderr ⇒ Object
Returns the value of attribute stderr.
22 23 24 |
# File 'lib/repub/app/logger.rb', line 22 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
21 22 23 |
# File 'lib/repub/app/logger.rb', line 21 def stdout @stdout end |
Instance Method Details
#debug(msg) ⇒ Object
24 25 26 |
# File 'lib/repub/app/logger.rb', line 24 def debug(msg) @stdout.puts(msg) if @level >= LOGGER_VERBOSE end |
#error(msg) ⇒ Object Also known as: warn
32 33 34 |
# File 'lib/repub/app/logger.rb', line 32 def error(msg) @stderr.puts(msg) if @level >= LOGGER_QUIET end |
#fatal(msg) ⇒ Object
37 38 39 40 |
# File 'lib/repub/app/logger.rb', line 37 def fatal(msg) error(msg) exit 1 end |
#info(msg) ⇒ Object
28 29 30 |
# File 'lib/repub/app/logger.rb', line 28 def info(msg) @stdout.puts(msg) if @level >= LOGGER_NORMAL end |