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::Loggerwith the provided channel.
Instance Method Summary
-
#alert(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Alertseverity. -
#alert(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Alertseverity. -
#critical(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Criticalseverity. -
#critical(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Criticalseverity. -
#debug(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Debugseverity. -
#debug(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Debugseverity. -
#emergency(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Emergencyseverity. -
#emergency(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Emergencyseverity. -
#error(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Errorseverity. -
#error(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Errorseverity. -
#fatal(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Criticalseverity. -
#fatal(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Criticalseverity. -
#info(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Infoseverity. -
#info(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Infoseverity. -
#notice(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Noticeseverity. -
#notice(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Noticeseverity. -
#unknown(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Debugseverity. -
#unknown(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Debugseverity. -
#warn(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Warningseverity. -
#warn(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Warningseverity. -
#warning(& : -> Crylog::MsgType) : Nil
Logs message and optionally context with
Crylog::Severity::Warningseverity. -
#warning(message, context : Crylog::LogContext? = nil) : Nil
Logs message and optionally context with
Crylog::Severity::Warningseverity.
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.