struct Crylog::Logger

Overview

A logger instance.

Defined in:

logger.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(channel : String) #

Creates a new Logger with the provided channel.


[View source]

Instance Method Detail

def alert(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Alert severity. Block is only evaluated if the message is logged.


[View source]
def alert(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Alert severity.


[View source]
def channel : String #

The channel self belongs to.


[View source]
def close #

Closes each handler defined on self.


[View source]
def critical(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Critical severity. Block is only evaluated if the message is logged.


[View source]
def critical(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Critical severity.


[View source]
def debug(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Debug severity.


[View source]
def debug(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Debug severity. Block is only evaluated if the message is logged.


[View source]
def emergency(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Emergency severity. Block is only evaluated if the message is logged.


[View source]
def emergency(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Emergency severity.


[View source]
def error(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Error severity. Block is only evaluated if the message is logged.


[View source]
def error(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Error severity.


[View source]
def handlers : Array(Crylog::Handlers::LogHandler) #

The handlers registered on self.


[View source]
def handlers=(handlers : Array(Crylog::Handlers::LogHandler)) : self #

Sets the handlers to use for self.


[View source]
def info(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Info severity. Block is only evaluated if the message is logged.


[View source]
def info(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Info severity.


[View source]
def notice(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Notice severity.


[View source]
def notice(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Notice severity. Block is only evaluated if the message is logged.


[View source]
def processors : Array(Crylog::Processors::LogProcessors) #

Processors registered on self.


[View source]
def processors=(processors : Array(Crylog::Processors::LogProcessors)) : self #

Sets the processors to use for self.


[View source]
def warning(message, context : Crylog::LogContext? = nil) : Nil #

Logs message and optionally context with Crylog::Severity::Warning severity.


[View source]
def warning(&block : -> Crylog::MsgType) : Nil #

Logs message and optionally context with Crylog::Severity::Warning severity. Block is only evaluated if the message is logged.


[View source]