ec_cmd_log
This provides simple output functions for command line apps.
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() = error | warn | info | debug
int_log_level() = 0..3
log_fun() = () -> iolist()
log_level() = int_log_level() | atom_log_level()
t()
Functions
new(LogLevel::log_level()) -> t()
Create a new 'log level' for the system
new(LogLevel, Caller) -> term()
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(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
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(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
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(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
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(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
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.
should(State_t::t(), LogLevel::int_log_level() | any()) -> boolean()
return a boolean indicating if the system should log for the specified levelg
log_level(State_t::t()) -> int_log_level()
get the current log level as an integer
atom_log_level(State_t::t()) -> atom_log_level()
get the current log level as an atom