Module ec_cmd_log

This provides simple output functions for command line apps.

Copyright © (C) 2012 Erlware, LLC.

Authors: Eric Merritt (ericbmerritt@gmail.com).

Description

This provides simple output functions for command line apps. You should use this to talk to the users if you are wrting code for the system

Data Types

atom_log_level()

atom_log_level() = error | warn | info | debug

caller()

caller() = api | command_line

int_log_level()

int_log_level() = 0..3

intensity()

intensity() = none | low | high

log_fun()

log_fun() = fun(() -> iolist())

log_level()

log_level() = int_log_level() | atom_log_level()

t()

abstract datatype: t()

Function Index

atom_log_level/1get the current log level as an atom.
debug/2log at the debug level given the current log state with a string or function that returns a string.
debug/3log at the debug level given the current log state with a format string and argements @see io:format/2.
error/2log at the error level given the current log state with a string or format string that returns a function.
error/3log at the error level given the current log state with a format string and argements @see io:format/2.
format/1
info/2log at the info level given the current log state with a string or function that returns a string.
info/3log at the info level given the current log state with a format string and argements @see io:format/2.
log/4when the module log level is less then or equal to the log level for the call then write the log info out.
log_level/1get the current log level as an integer.
new/1Create a new 'log level' for the system.
new/2
new/3
should/2return a boolean indicating if the system should log for the specified levelg.
warn/2log at the warn level given the current log state with a string or format string that returns a function.
warn/3log at the warn level given the current log state with a format string and argements @see io:format/2.

Function Details

atom_log_level/1

atom_log_level(State_t::t()) -> atom_log_level()

get the current log level as an atom

debug/2

debug(LogState::t(), Fun::string() | log_fun()) -> ok

log at the debug level given the current log state with a string or function that returns a string

debug/3

debug(LogState::t(), FormatString::string(), Args::[any()]) -> ok

log at the debug level given the current log state with a format string and argements @see io:format/2

error/2

error(LogState::t(), Fun::string() | log_fun()) -> ok

log at the error level given the current log state with a string or format string that returns a function

error/3

error(LogState::t(), FormatString::string(), Args::[any()]) -> ok

log at the error level given the current log state with a format string and argements @see io:format/2

format/1

format(Log::t()) -> iolist()

info/2

info(LogState::t(), Fun::string() | log_fun()) -> ok

log at the info level given the current log state with a string or function that returns a string

info/3

info(LogState::t(), FormatString::string(), Args::[any()]) -> ok

log at the info level given the current log state with a format string and argements @see io:format/2

log/4

log(State_t::t(), LogLevel::int_log_level(), FormatString::string(), Args::[any()]) -> ok

when the module log level is less then or equal to the log level for the call then write the log info out. When its not then ignore the call.

log_level/1

log_level(State_t::t()) -> int_log_level()

get the current log level as an integer

new/1

new(LogLevel::log_level()) -> t()

Create a new 'log level' for the system

new/2

new(LogLevel::log_level(), Caller::caller()) -> t()

new/3

new(LogLevel::log_level(), Caller::caller(), Intensity::intensity()) -> t()

should/2

should(State_t::t(), LogLevel::int_log_level() | any()) -> boolean()

return a boolean indicating if the system should log for the specified levelg

warn/2

warn(LogState::t(), Fun::string() | log_fun()) -> ok

log at the warn level given the current log state with a string or format string that returns a function

warn/3

warn(LogState::t(), FormatString::string(), Args::[any()]) -> ok

log at the warn level given the current log state with a format string and argements @see io:format/2


Generated by EDoc, May 1 2024, 06:09:58.