mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
log: extended logging level names when printed
This commit is contained in:
parent
f9d5c0110f
commit
d4b0de2dce
1 changed files with 26 additions and 24 deletions
|
@ -1,9 +1,11 @@
|
||||||
module log
|
module log
|
||||||
|
|
||||||
import os
|
import (
|
||||||
import time
|
os
|
||||||
import term
|
time
|
||||||
import filepath
|
term
|
||||||
|
filepath
|
||||||
|
)
|
||||||
|
|
||||||
pub enum LogLevel {
|
pub enum LogLevel {
|
||||||
fatal = 1
|
fatal = 1
|
||||||
|
@ -15,11 +17,11 @@ pub enum LogLevel {
|
||||||
|
|
||||||
fn tag(l LogLevel) string {
|
fn tag(l LogLevel) string {
|
||||||
return match l {
|
return match l {
|
||||||
.fatal { term.red('F') }
|
.fatal { term.red('FATAL') }
|
||||||
.error { term.red('E') }
|
.error { term.red('ERROR') }
|
||||||
.warn { term.yellow('W') }
|
.warn { term.yellow('WARN ') }
|
||||||
.info { term.white('I') }
|
.info { term.white('INFO ') }
|
||||||
.debug { term.blue('D') }
|
.debug { term.blue('DEBUG') }
|
||||||
else { ' ' }
|
else { ' ' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue