Module logger

A naive implementation of the Erlang/OTP logger interface.

Description

This module implements a strict subset of the Erlang/OTP logger interface, supporting operations for logging messages to various log handlers. A default handler (logger_std_h) supports logging to the console.

This module is designed to be API-compatible with the Erlang/OTP logger API, with exceptions noted below. Users can use macros defined in the Erlang/OTP logger.hrl header for logging messages.

Limitations include but are not limited to:

  • No support for logging filters

  • No support for logging formatters

  • No API support for logger configuration; all configuration must be done at initialization of the logger_manager

  • No support for throttling or compacting sequences of repeated log messages

Data Types

level()


level() = emergency | alert | critical | error | warning | notice | info | debug

string_or_report()


string_or_report() = string() | map()

Function Index

alert/1 Log a string at alert log level.
alert/2 Log a format string with args at alert log level.
alert/3 Log a format string with args at alert log level with the specified metadata.
allow/2 Determine whether logging should be permitted at the specified level for the specified module.
compare/2 Return comparison between levels.
critical/1 Log a string at critical log level.
critical/2 Log a format string with args at critical log level.
critical/3 Log a format string with args at critical log level with the specified metadata.
debug/1 Log a string at debug log level.
debug/2 Log a format string with args at debug log level.
debug/3 Log a format string with args at debug log level with the specified metadata.
emergency/1 Log a string at emergency log level.
emergency/2 Log a format string with args at emergency log level.
emergency/3 Log a format string with args at emergency log level with the specified metadata.
error/1 Log a string at error log level.
error/2 Log a format string with args at error log level.
error/3 Log a format string with args at error log level with the specified metadata.
info/1 Log a string at info log level.
info/2 Log a format string with args at info log level.
info/3 Log a format string with args at info log level with the specified metadata.
log/2 Log a string at the specified log level.
log/3 Log a format string with args at the specified log level.
log/4 Log a format string with args at the specified log level with the specified metadata.
notice/1 Log a string at notice log level.
notice/2 Log a format string with args at notice log level.
notice/3 Log a format string with args at notice log level with the specified metadata.
warning/1 Log a string at warning log level.
warning/2 Log a format string with args at warning log level.
warning/3 Log a format string with args at warning log level with the specified metadata.

Function Details

alert/1


alert(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at alert log level.

alert/2


alert(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at alert log level.

alert/3


alert(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at alert log level with the specified metadata.

allow/2


allow(Level::level(), Module::atom()) -> boolean()

Level: the log level
Module: the module

returns: true if logging should be permitted at the specified level for the specified module; false, otherwise.

Determine whether logging should be permitted at the specified level for the specified module

compare/2


compare(Level1::level(), Level2::level()) -> lt | eq | gt

Level1: a level
Level2: a level

returns: lt | eq | gt

Return comparison between levels

lt if Level1 < Level2 eq if Level1 == Level2 gt if Level1 > Level2

critical/1


critical(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at critical log level.

critical/2


critical(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at critical log level.

critical/3


critical(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at critical log level with the specified metadata.

debug/1


debug(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at debug log level.

debug/2


debug(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at debug log level.

debug/3


debug(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at debug log level with the specified metadata.

emergency/1


emergency(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at emergency log level.

emergency/2


emergency(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at emergency log level.

emergency/3


emergency(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at emergency log level with the specified metadata.

error/1


error(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at error log level.

error/2


error(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at error log level.

error/3


error(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at error log level with the specified metadata.

info/1


info(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at info log level.

info/2


info(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at info log level.

info/3


info(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at info log level with the specified metadata.

log/2


log(Level::level(), StringOrReport::string_or_report()) -> ok

Level: log level
StringOrReport: string or report map

returns: ok

Log a string at the specified log level.

log/3


log(Level::level(), FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

Level: log level
FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at the specified log level.

log/4


log(Level::level(), Format::string(), Args::list(), Meta::map()) -> ok

Level: log level
Format: format string
Args: format string arguments
Meta: log metadata

returns: ok

Log a format string with args at the specified log level with the specified metadata.

notice/1


notice(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at notice log level.

notice/2


notice(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at notice log level.

notice/3


notice(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at notice log level with the specified metadata.

warning/1


warning(StringOrReport::string_or_report()) -> ok

StringOrReport: string or report

returns: ok

Log a string at warning log level.

warning/2


warning(FormatOrReport::string_or_report(), ArgsOrMeta::list() | map()) -> ok

FormatOrReport: format string or report
ArgsOrMeta: format string arguments or metadata

returns: ok

Log a format string with args at warning log level.

warning/3


warning(Format::string(), Args::list(), MetaData::map()) -> ok

Format: format string
Args: format string arguments
MetaData: log metadata

returns: ok

Log a format string with args at warning log level with the specified metadata.