struct Crylog::Formatters::JsonFormatter
- Crylog::Formatters::JsonFormatter
- Crylog::Formatters::LogFormatter
- Struct
- Value
- Object
Overview
Formats the message as a JSON string.
Defined in:
formatters/json_formatter.crConstructors
-
.new(pretty_print : Bool = false)
Instantiates
self
, outputting a pretty JSON string if pretty_print.
Instance Method Summary
-
#call(message : Crylog::Message) : String
Consumes a message and returns a formatted string representation of it.
-
#pretty_print : Bool
Whether the JSON string should be pretty printed.
-
#pretty_print=(pretty_print : Bool)
Whether the JSON string should be pretty printed.
Instance methods inherited from struct Crylog::Formatters::LogFormatter
call(message : Message) : String
call,
initialize
initialize
Constructor methods inherited from struct Crylog::Formatters::LogFormatter
new
new
Constructor Detail
def self.new(pretty_print : Bool = false)
#
Instantiates self
, outputting a pretty JSON string if pretty_print.
Instance Method Detail
def call(message : Crylog::Message) : String
#
Consumes a message and returns a formatted string representation of it.