enum Level {
fatal = 1
error
warn
info
debug
}
Level defines possible log levels used by Log
struct Log {
mut:
level Level
output_label string
ofile os.File
output_to_file bool
pub mut:
output_file_name string
}
Log represents a logging object
fn (mut l Log) set_level(level Level)
set_level sets the internal logging to level
.
fn (mut l Log) set_output_level(level Level)
set_output_level sets the internal logging output to level
.
fn (mut l Log) set_full_logpath(full_log_path string)
set_full_logpath sets the output label and output path from full_log_path
.
fn (mut l Log) set_output_label(label string)
set_output_label sets the label
for the output.
fn (mut l Log) set_output_path(output_file_path string)
set_output_path sets the file to which output is logged to.
fn (mut l Log) flush()
flush writes the log file content to disk.
fn (mut l Log) close()
close closes the log file.
fn (mut l Log) fatal(s string)
fatal logs line s
via send_output
if Log.level
is greater than or equal to the Level.fatal
category.
fn (mut l Log) error(s string)
error logs line s
via send_output
if Log.level
is greater than or equal to the Level.error
category.
fn (mut l Log) warn(s string)
warn logs line s
via send_output
if Log.level
is greater than or equal to the Level.warn
category.
fn (mut l Log) info(s string)
info logs line s
via send_output
if Log.level
is greater than or equal to the Level.info
category.
fn (mut l Log) debug(s string)
debug logs line s
via send_output
if Log.level
is greater than or equal to the Level.debug
category.