Class: DumpCleaner::Log
- Inherits:
-
Logger
- Object
- Logger
- DumpCleaner::Log
- Includes:
- Singleton
- Defined in:
- lib/dump_cleaner/log.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
- .debug(&block) ⇒ Object
- .error(&block) ⇒ Object
- .fatal(&block) ⇒ Object
- .info(&block) ⇒ Object
- .warn(&block) ⇒ Object
Instance Method Summary collapse
- #init_log_level ⇒ Object
-
#initialize ⇒ Log
constructor
A new instance of Log.
Constructor Details
#initialize ⇒ Log
Returns a new instance of Log.
11 12 13 14 15 16 |
# File 'lib/dump_cleaner/log.rb', line 11 def initialize super($stdout) init_log_level self.formatter = ->(severity, datetime, _progname, msg) { "#{datetime} #{severity}: #{msg}\n" } end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/dump_cleaner/log.rb', line 9 def logger @logger end |
Class Method Details
.debug(&block) ⇒ Object
22 23 24 |
# File 'lib/dump_cleaner/log.rb', line 22 def self.debug(&block) instance.debug(&block) end |
.error(&block) ⇒ Object
34 35 36 |
# File 'lib/dump_cleaner/log.rb', line 34 def self.error(&block) instance.error(&block) end |
.fatal(&block) ⇒ Object
38 39 40 |
# File 'lib/dump_cleaner/log.rb', line 38 def self.fatal(&block) instance.fatal(&block) end |
.info(&block) ⇒ Object
26 27 28 |
# File 'lib/dump_cleaner/log.rb', line 26 def self.info(&block) instance.info(&block) end |
.warn(&block) ⇒ Object
30 31 32 |
# File 'lib/dump_cleaner/log.rb', line 30 def self.warn(&block) instance.warn(&block) end |
Instance Method Details
#init_log_level ⇒ Object
18 19 20 |
# File 'lib/dump_cleaner/log.rb', line 18 def init_log_level self.level = Logger::INFO end |