mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
log: extended logging level names when printed
This commit is contained in:
parent
f9d5c0110f
commit
d4b0de2dce
@ -1,9 +1,11 @@
|
||||
module log
|
||||
|
||||
import os
|
||||
import time
|
||||
import term
|
||||
import filepath
|
||||
import (
|
||||
os
|
||||
time
|
||||
term
|
||||
filepath
|
||||
)
|
||||
|
||||
pub enum LogLevel {
|
||||
fatal = 1
|
||||
@ -15,11 +17,11 @@ pub enum LogLevel {
|
||||
|
||||
fn tag(l LogLevel) string {
|
||||
return match l {
|
||||
.fatal { term.red('F') }
|
||||
.error { term.red('E') }
|
||||
.warn { term.yellow('W') }
|
||||
.info { term.white('I') }
|
||||
.debug { term.blue('D') }
|
||||
.fatal { term.red('FATAL') }
|
||||
.error { term.red('ERROR') }
|
||||
.warn { term.yellow('WARN ') }
|
||||
.info { term.white('INFO ') }
|
||||
.debug { term.blue('DEBUG') }
|
||||
else { ' ' }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user