Class: Tailor::Logger
- Inherits:
-
Object
- Object
- Tailor::Logger
- Extended by:
- LogSwitch
- Defined in:
- lib/tailor/logger.rb
Defined Under Namespace
Modules: Mixin
Class Method Summary collapse
- .format_message(_, time, _, msg) ⇒ Object
-
.logger ⇒ Object
Overrides the LogSwitch Logger to custom format the time format in log messages.
Class Method Details
.format_message(_, time, _, msg) ⇒ Object
13 14 15 |
# File 'lib/tailor/logger.rb', line 13 def @logger.(_, time, _, msg) "[#{time.strftime('%Y-%m-%d %H:%M:%S')}] #{msg}\n" end |
.logger ⇒ Object
Overrides the LogSwitch Logger to custom format the time format in log messages.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tailor/logger.rb', line 9 def self.logger return @logger if @logger @logger ||= ::Logger.new $stdout def @logger.(_, time, _, msg) "[#{time.strftime('%Y-%m-%d %H:%M:%S')}] #{msg}\n" end @logger end |