class Gallus::Format::SimpleConsole
Public: This console log format is used for command line apps. Instead of using puts-es and write-s to display stuff use logger! INFO level will be displayed without prefixes, as is - just message and context info. Other levels will be prefixed with level name. Example:
Hello, this is info message ERROR: Upps, something went wrong; foo="Bar" Another info message DEBUG: Here's debug information ...
Public Class Methods
new(serialization = Serialization::Inspect)
click to toggle source
# File lib/gallus/format/simple_console.rb, line 14 def initialize(serialization = Serialization::Inspect) @serialization = serialization end
Public Instance Methods
call(event)
click to toggle source
# File lib/gallus/format/simple_console.rb, line 18 def call(event) parts = [ [ event.message, @serialization.call(event.payload) ].compact.join('; ') ] parts.unshift(format("%s:", event.level.name)) unless event.level == Level::INFO parts.compact.join(' ') end