1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

log: added timestamps

This commit is contained in:
Mike 'Fuzzy' Partin 2019-07-29 07:34:23 -07:00 committed by Alexander Medvednikov
parent d87030972e
commit ff72d9104d

View File

@ -46,7 +46,8 @@ pub fn (l Log) error(s string){
switch l.output {
case 'terminal':
f := term.red('E')
println('[$f]$s')
t := time.now()
println('[$f ${t.format()}] $s')
default:
l.log_file(s, 'E')
@ -59,7 +60,8 @@ pub fn (l Log) warn(s string){
switch l.output {
case 'terminal':
f := term.yellow('W')
println('[$f]$s')
t := time.now()
println('[$f ${t.format()}] $s')
default:
l.log_file(s, 'W')
@ -72,7 +74,8 @@ pub fn (l Log) info(s string){
switch l.output {
case 'terminal':
f := term.white('I')
println('[$f]$s')
t := time.now()
println('[$f ${t.format()}] $s')
default:
l.log_file(s, 'I')
@ -85,7 +88,8 @@ pub fn (l Log) debug(s string){
switch l.output {
case 'terminal':
f := term.blue('D')
println('[$f]$s')
t := time.now()
println('[$f ${t.format()}] $s')
default:
l.log_file(s, 'D')