Class: Diffend::Logger
- Inherits:
-
Object
- Object
- Diffend::Logger
- Defined in:
- lib/diffend/logger.rb
Overview
Diffend logging
Constant Summary collapse
- DEBUG =
Low-level information, mostly for developers.
0- INFO =
Generic (useful) information about system operation.
1- WARN =
A warning.
2- ERROR =
A handleable error condition.
3- FATAL =
An unhandleable error that results in a program crash.
4- UNKNOWN =
An unknown message that should always be logged.
5
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #fatal(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(level = INFO) ⇒ Logger
constructor
A new instance of Logger.
- #warn(message) ⇒ Object
Constructor Details
#initialize(level = INFO) ⇒ Logger
Returns a new instance of Logger.
20 21 22 |
# File 'lib/diffend/logger.rb', line 20 def initialize(level = INFO) @level = level end |
Instance Method Details
#debug(message) ⇒ Object
25 26 27 |
# File 'lib/diffend/logger.rb', line 25 def debug() log(DEBUG, ) end |
#error(message) ⇒ Object
40 41 42 |
# File 'lib/diffend/logger.rb', line 40 def error() log(ERROR, ) end |
#fatal(message) ⇒ Object
45 46 47 |
# File 'lib/diffend/logger.rb', line 45 def fatal() log(FATAL, ) end |
#info(message) ⇒ Object
30 31 32 |
# File 'lib/diffend/logger.rb', line 30 def info() log(INFO, ) end |
#warn(message) ⇒ Object
35 36 37 |
# File 'lib/diffend/logger.rb', line 35 def warn() log(WARN, ) end |