Module lager

The lager logging framework.

Description

The lager logging framework.

Data Types

log_level()

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

log_level_number()

log_level_number() = 0..7

Function Index

clear_all_traces/0
dispatch_log/5
dispatch_log/7
dispatch_log/9
do_log/9
get_loglevel/1Get the loglevel for a particular backend on the default sink.
get_loglevel/2Get the loglevel for a particular sink's backend.
list_all_sinks/0
log/3Manually log a message into lager without using the parse transform.
log/4Manually log a message into lager without using the parse transform.
log/5Manually log a message into lager without using the parse transform.
log_unsafe/4
md/0Get lager metadata for current process.
md/1Set lager metadata for current process.
posix_error/1Try to convert an atom to a posix error, but fall back on printing the term if its not a valid posix error code.
pr/2Print a record or a list of records lager found during parse transform.
pr/3Print a record or a list of records lager found during parse transform.
pr_stacktrace/1Print stacktrace in human readable form.
pr_stacktrace/2
rotate_all/0
rotate_handler/1
rotate_handler/2
rotate_sink/1
safe_format/3Print the format string Fmt with Args safely with a size limit of Limit.
set_loghwm/2Set the loghwm for the default sink.
set_loghwm/3Set the loghwm for a particular backend.
set_loghwm/4Set the loghwm (log high water mark) for file backends with multiple identifiers.
set_loglevel/2Set the loglevel for a particular backend.
set_loglevel/3Set the loglevel for a particular backend that has multiple identifiers (eg.
set_loglevel/4Set the loglevel for a particular sink's backend that potentially has multiple identifiers.
start/0Start the application.
status/0
stop_trace/1
stop_trace/3
trace/2
trace/3
trace_console/1
trace_console/2
trace_file/2
trace_file/3
trace_file/4
update_loglevel_config/1recalculate min log level.

Function Details

clear_all_traces/0

clear_all_traces() -> any()

dispatch_log/5

dispatch_log(Severity, Metadata, Format, Args, Size) -> any()

dispatch_log/7

dispatch_log(Sink::atom(), Severity::log_level(), Metadata::list(), Format::string(), Args::list() | none, Size::pos_integer(), Safety::safe | unsafe) -> ok | {error, lager_not_running} | {error, {sink_not_configured, atom()}}

dispatch_log/9

dispatch_log(Severity, Module, Function, Line, Pid, Metadata, Format, Args, Size) -> any()

do_log/9

do_log(Severity, Metadata, Format, Args, Size, SeverityAsInt, LevelThreshold, TraceFilters, SinkPid) -> any()

get_loglevel/1

get_loglevel(Handler) -> any()

Get the loglevel for a particular backend on the default sink. In the case that the backend has multiple identifiers, the lowest is returned.

get_loglevel/2

get_loglevel(Sink, Handler) -> any()

Get the loglevel for a particular sink's backend. In the case that the backend has multiple identifiers, the lowest is returned.

list_all_sinks/0

list_all_sinks() -> any()

log/3

log(Level::log_level(), Pid::pid() | atom() | [tuple(), ...], Message::list()) -> ok | {error, lager_not_running}

Manually log a message into lager without using the parse transform.

log/4

log(Level::log_level(), Pid::pid() | atom() | [tuple(), ...], Format::string(), Args::list()) -> ok | {error, lager_not_running}

Manually log a message into lager without using the parse transform.

log/5

log(Sink::atom(), Level::log_level(), Pid::pid() | atom() | [tuple(), ...], Format::string(), Args::list()) -> ok | {error, lager_not_running}

Manually log a message into lager without using the parse transform.

log_unsafe/4

log_unsafe(Level, Metadata, Format, Args) -> any()

md/0

md() -> [{atom(), any()}]

Get lager metadata for current process

md/1

md(NewMD::[{atom(), any()}, ...]) -> ok

Set lager metadata for current process. Will badarg if you don't supply a list of {key, value} tuples keyed by atoms.

posix_error/1

posix_error(Error) -> any()

Try to convert an atom to a posix error, but fall back on printing the term if its not a valid posix error code.

pr/2

pr(Record, Module) -> any()

Print a record or a list of records lager found during parse transform

pr/3

pr(Record, Module, Options) -> any()

Print a record or a list of records lager found during parse transform

pr_stacktrace/1

pr_stacktrace(Stacktrace) -> any()

Print stacktrace in human readable form

pr_stacktrace/2

pr_stacktrace(Stacktrace, X2) -> any()

rotate_all/0

rotate_all() -> any()

rotate_handler/1

rotate_handler(Handler) -> any()

rotate_handler/2

rotate_handler(Handler, Sink) -> any()

rotate_sink/1

rotate_sink(Sink) -> any()

safe_format/3

safe_format(Fmt, Args, Limit) -> any()

Print the format string Fmt with Args safely with a size limit of Limit. If the format string is invalid, or not enough arguments are supplied 'FORMAT ERROR' is printed with the offending arguments. The caller is NOT crashed.

set_loghwm/2

set_loghwm(Handler, Hwm) -> any()

Set the loghwm for the default sink.

set_loghwm/3

set_loghwm(Sink, Handler, Hwm) -> any()

Set the loghwm for a particular backend.

set_loghwm/4

set_loghwm(Sink, Handler, Ident, Hwm) -> any()

Set the loghwm (log high water mark) for file backends with multiple identifiers

set_loglevel/2

set_loglevel(Handler, Level) -> any()

Set the loglevel for a particular backend.

set_loglevel/3

set_loglevel(Handler, Ident, Level) -> any()

Set the loglevel for a particular backend that has multiple identifiers (eg. the file backend).

set_loglevel/4

set_loglevel(Sink, Handler, Ident, Level) -> any()

Set the loglevel for a particular sink's backend that potentially has multiple identifiers. (Use undefined if it doesn't have any.)

start/0

start() -> any()

Start the application. Mainly useful for using -s lager as a command line switch to the VM to make lager start on boot.

status/0

status() -> any()

stop_trace/1

stop_trace(X1) -> any()

stop_trace/3

stop_trace(Backend, Filter, Level) -> any()

trace/2

trace(Backend, Filter) -> any()

trace/3

trace(Backend, Filter, Level) -> any()

trace_console/1

trace_console(Filter) -> any()

trace_console/2

trace_console(Filter, Level) -> any()

trace_file/2

trace_file(File, Filter) -> any()

trace_file/3

trace_file(File, Filter, Level) -> any()

trace_file/4

trace_file(File, Filter, Level, Options) -> any()

update_loglevel_config/1

update_loglevel_config(Sink) -> any()

recalculate min log level


Generated by EDoc