vieter/src/web/logging.v

37 lines
738 B
Coq
Raw Normal View History

2022-01-11 14:01:13 +01:00
module web
2022-01-14 22:46:04 +01:00
// lfatal create a log message with the fatal level
2022-11-01 21:10:45 +01:00
pub fn (mut ctx Context) lfatal(msg string) {
lock ctx.logger {
ctx.logger.fatal(msg)
}
2022-01-11 14:01:13 +01:00
}
2022-01-14 22:46:04 +01:00
// lerror create a log message with the error level
2022-11-01 21:10:45 +01:00
pub fn (mut ctx Context) lerror(msg string) {
lock ctx.logger {
ctx.logger.error(msg)
}
2022-01-11 14:01:13 +01:00
}
2022-01-14 22:46:04 +01:00
// lwarn create a log message with the warn level
2022-11-01 21:10:45 +01:00
pub fn (mut ctx Context) lwarn(msg string) {
lock ctx.logger {
ctx.logger.warn(msg)
}
2022-01-11 14:01:13 +01:00
}
2022-01-14 22:46:04 +01:00
// linfo create a log message with the info level
2022-11-01 21:10:45 +01:00
pub fn (mut ctx Context) linfo(msg string) {
lock ctx.logger {
ctx.logger.info(msg)
}
2022-01-11 14:01:13 +01:00
}
2022-01-14 22:46:04 +01:00
// ldebug create a log message with the debug level
2022-11-01 21:10:45 +01:00
pub fn (mut ctx Context) ldebug(msg string) {
lock ctx.logger {
ctx.logger.debug(msg)
}
2022-01-11 14:01:13 +01:00
}