refactor: compile on V 0.3.2

This commit is contained in:
Jef Roosens 2022-11-01 21:10:45 +01:00
parent ed29102717
commit 22fd6e395b
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
23 changed files with 205 additions and 203 deletions

View file

@ -3,33 +3,33 @@ module web
import log
// log reate a log message with the given level
pub fn (mut ctx Context) log(msg &string, level log.Level) {
pub fn (mut ctx Context) log(msg string, level log.Level) {
lock ctx.logger {
ctx.logger.send_output(msg, level)
}
}
// lfatal create a log message with the fatal level
pub fn (mut ctx Context) lfatal(msg &string) {
pub fn (mut ctx Context) lfatal(msg string) {
ctx.log(msg, log.Level.fatal)
}
// lerror create a log message with the error level
pub fn (mut ctx Context) lerror(msg &string) {
pub fn (mut ctx Context) lerror(msg string) {
ctx.log(msg, log.Level.error)
}
// lwarn create a log message with the warn level
pub fn (mut ctx Context) lwarn(msg &string) {
pub fn (mut ctx Context) lwarn(msg string) {
ctx.log(msg, log.Level.warn)
}
// linfo create a log message with the info level
pub fn (mut ctx Context) linfo(msg &string) {
pub fn (mut ctx Context) linfo(msg string) {
ctx.log(msg, log.Level.info)
}
// ldebug create a log message with the debug level
pub fn (mut ctx Context) ldebug(msg &string) {
pub fn (mut ctx Context) ldebug(msg string) {
ctx.log(msg, log.Level.debug)
}