Class: Factor::Log::BasicLogger
Instance Attribute Summary collapse
-
#destination_stream ⇒ Object
Returns the value of attribute destination_stream.
Instance Method Summary collapse
- #error(options = {}) ⇒ Object
- #info(options = {}) ⇒ Object
- #log(section, options = {}) ⇒ Object
- #success(options = {}) ⇒ Object
- #warn(options = {}) ⇒ Object
Methods inherited from Logger
Instance Attribute Details
#destination_stream ⇒ Object
Returns the value of attribute destination_stream.
7 8 9 |
# File 'lib/logger/basic.rb', line 7 def destination_stream @destination_stream end |
Instance Method Details
#error(options = {}) ⇒ Object
26 27 28 |
# File 'lib/logger/basic.rb', line 26 def error( = {}) log :error, end |
#info(options = {}) ⇒ Object
18 19 20 |
# File 'lib/logger/basic.rb', line 18 def info( = {}) log :info, end |
#log(section, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/logger/basic.rb', line 9 def log(section, ={}) = { message: } if .is_a?(String) tag = tag() = ['message'] || [:message] section_text = format_section(section) write "[ #{section_text} ] [#{time}]#{tag} #{}" if exception [:exception] if [:exception] end |
#success(options = {}) ⇒ Object
30 31 32 |
# File 'lib/logger/basic.rb', line 30 def success( = {}) log :success, end |
#warn(options = {}) ⇒ Object
22 23 24 |
# File 'lib/logger/basic.rb', line 22 def warn( = {}) log :warn, end |