class Crylog::CrylogLogger
- Crylog::CrylogLogger
- Logger
- Reference
- Object
Overview
Compatibility class to support using Crylog
with the ::Logger
type.
Defines Crylog::Logger
logging methods as well as maps ::Logger::Severity
methods to Crylog::Severity
methods.
Crylog.configure do |registry|
registry.register "main" do |logger|
logger.handlers = [
Crylog::Handlers::IOHandler.new STDOUT,
] of Crylog::Handlers::LogHandler
end
end
one : ::Logger = Logger.new STDOUT
two : ::Logger = Crylog::CrylogLogger.new
one.warn "FOO" # => W, [2019-10-15 19:17:26 -04:00 #19986] WARN -- : FOO
two.warn "FOO" # => [2019-10-15T23:17:26.042287000Z] main.WARNING: FOO
Defined in:
crylog_logger.crConstructors
-
.new(channel : String = Crylog.default_channel)
Use the
Crylog::Logger
with the provided channel.
Instance Method Summary
-
#alert(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Alert
severity. -
#alert(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Alert
severity. -
#critical(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Critical
severity. -
#critical(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Critical
severity. -
#debug(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Debug
severity. -
#debug(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Debug
severity. -
#emergency(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Emergency
severity. -
#emergency(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Emergency
severity. -
#error(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Error
severity. -
#error(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Error
severity. -
#fatal(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Critical
severity. -
#fatal(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Critical
severity. -
#info(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Info
severity. -
#info(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Info
severity. -
#notice(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Notice
severity. -
#notice(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Notice
severity. -
#unknown(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Debug
severity. -
#unknown(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Debug
severity. -
#warn(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Warning
severity. -
#warn(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Warning
severity. -
#warning(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Warning
severity. -
#warning(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Warning
severity.
Macro Summary
Constructor Detail
Use the Crylog::Logger
with the provided channel.
Instance Method Detail
Logs message and optionally context with Crylog::Severity::Alert
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Alert
severity.
Logs message and optionally context with Crylog::Severity::Critical
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Critical
severity.
Logs message and optionally context with Crylog::Severity::Debug
severity.
Logs message and optionally context with Crylog::Severity::Debug
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Emergency
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Emergency
severity.
Logs message and optionally context with Crylog::Severity::Error
severity.
Logs message and optionally context with Crylog::Severity::Error
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Critical
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Critical
severity.
Logs message and optionally context with Crylog::Severity::Info
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Info
severity.
Logs message and optionally context with Crylog::Severity::Notice
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Notice
severity.
Logs message and optionally context with Crylog::Severity::Debug
severity.
Logs message and optionally context with Crylog::Severity::Debug
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Warning
severity.
Logs message and optionally context with Crylog::Severity::Warning
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Warning
severity.
Block is evaluated at least once due to https://github.com/crystal-lang/crystal/issues/8485.
Logs message and optionally context with Crylog::Severity::Warning
severity.