From ff72d9104da67808ec109319d3a460f70b9c497f Mon Sep 17 00:00:00 2001 From: Mike 'Fuzzy' Partin Date: Mon, 29 Jul 2019 07:34:23 -0700 Subject: [PATCH] log: added timestamps --- vlib/log/log.v | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vlib/log/log.v b/vlib/log/log.v index 8e64724f61..2a3a68bc42 100644 --- a/vlib/log/log.v +++ b/vlib/log/log.v @@ -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')