Class: Agentic::Logger::SimpleFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Agentic::Logger::SimpleFormatter
- Defined in:
- lib/agentic/logger.rb
Overview
Simple formatter which only displays the message.
Instance Method Summary collapse
-
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs.
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs
19 20 21 22 23 24 25 |
# File 'lib/agentic/logger.rb', line 19 def call(severity, , progname, msg) if $stdout.tty? && severity.respond_to?(:colorize) "#{severity.colorize(COLORS[severity])}: #{(String === msg) ? msg : msg.inspect}\n" else "#{severity}: #{(String === msg) ? msg : msg.inspect}\n" end end |