struct Crylog::Formatters::JsonFormatter

Overview

Formats the message as a JSON string.

Defined in:

formatters/json_formatter.cr

Constructors

Instance Method Summary

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.


[View source]

Instance Method Detail

def call(message : Crylog::Message) : String #

Consumes a message and returns a formatted string representation of it.


[View source]
def pretty_print : Bool #

Whether the JSON string should be pretty printed.


[View source]
def pretty_print=(pretty_print : Bool) #

Whether the JSON string should be pretty printed.


[View source]