Class: Tumugi::Logger
- Inherits:
-
Object
- Object
- Tumugi::Logger
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/tumugi/logger/logger.rb
Instance Attribute Summary collapse
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
Instance Method Summary collapse
- #init(output: STDOUT, format: :text) ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #quiet! ⇒ Object
- #verbose! ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
15 16 17 18 19 20 21 |
# File 'lib/tumugi/logger/logger.rb', line 15 def initialize @formatters = { text: text_formatter, json: json_formatter } init end |
Instance Attribute Details
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
13 14 15 |
# File 'lib/tumugi/logger/logger.rb', line 13 def workflow_id @workflow_id end |
Instance Method Details
#init(output: STDOUT, format: :text) ⇒ Object
23 24 25 26 27 |
# File 'lib/tumugi/logger/logger.rb', line 23 def init(output: STDOUT, format: :text) @logger = ::Logger.new(output) @logger.level = ::Logger::INFO @logger.formatter = @formatters[format] end |
#quiet! ⇒ Object
33 34 35 |
# File 'lib/tumugi/logger/logger.rb', line 33 def quiet! @logger = ::Logger.new(nil) end |
#verbose! ⇒ Object
29 30 31 |
# File 'lib/tumugi/logger/logger.rb', line 29 def verbose! @logger.level = ::Logger::DEBUG end |