const LEVEL_DEBUG
pub const LEVEL_DEBUG = -4Purpose
Constant LEVEL_DEBUG, defining protocol or algorithm parameters.
#log/slogStructured logging. No package-level default logger. Text or one JSON object per line.
const LEVEL_DEBUGpub const LEVEL_DEBUG = -4Constant LEVEL_DEBUG, defining protocol or algorithm parameters.
const LEVEL_INFOpub const LEVEL_INFO = 0Constant LEVEL_INFO, defining protocol or algorithm parameters.
const LEVEL_WARNpub const LEVEL_WARN = 4Constant LEVEL_WARN, defining protocol or algorithm parameters.
const LEVEL_ERRORpub const LEVEL_ERROR = 8Constant LEVEL_ERROR, defining protocol or algorithm parameters.
struct Loggerpub struct Logger {
pub min_level int
pub add_source int
pub add_time int
pub use_stdout bool
}Structure encapsulating min_level, add_source, add_time, use_stdout.
min_level intadd_source intadd_time intuse_stdout boolnew_loggerpub fn new_logger() LoggerConstruct logger.
No arguments are required.
Logger — a value of this type
new_json_loggerpub fn new_json_logger() LoggerConstruct json logger.
No arguments are required.
Logger — a value of this type
($&Logger) set_levelpub fn (l $&Logger) set_level(level int)Operation on $&Logger: set level.
l $&LoggerLogger instance used by this call (exclusive borrow).level intThis call does not return a value.
(Logger) withpub fn (l Logger) with(kvs <-> string) LoggerExecute with on Logger.
l LoggerLogger instance used by this call (value receiver).kvs <-> stringLogger — a value of this type
(Logger) with_grouppub fn (l Logger) with_group(name string) LoggerOperation on Logger: derive a new value with group.
l LoggerLogger instance used by this call (value receiver).name stringLogger — a value of this type
(&Logger) enabledpub fn (l &Logger) enabled(level int) boolExecute enabled on &Logger.
l &LoggerLogger instance used by this call (borrow).level intbool — true or false
(&Logger) logpub fn (l &Logger) log(level int, msg string)Operation on &Logger: natural logarithm.
l &LoggerLogger instance used by this call (borrow).level intmsg stringThis call does not return a value.
(&Logger) debugpub fn (l &Logger) debug(msg string, kvs <-> string)Execute debug on &Logger.
l &LoggerLogger instance used by this call (borrow).msg stringkvs <-> stringThis call does not return a value.
(&Logger) infopub fn (l &Logger) info(msg string, kvs <-> string)Execute info on &Logger.
l &LoggerLogger instance used by this call (borrow).msg stringkvs <-> stringThis call does not return a value.
(&Logger) warnpub fn (l &Logger) warn(msg string, kvs <-> string)Execute warn on &Logger.
l &LoggerLogger instance used by this call (borrow).msg stringkvs <-> stringThis call does not return a value.
(&Logger) errorpub fn (l &Logger) error(msg string, kvs <-> string)Execute error on &Logger.
l &LoggerLogger instance used by this call (borrow).msg stringkvs <-> stringThis call does not return a value.