From 0adcd85023f7ccbbc81ded7aa4446fff86149bc7 Mon Sep 17 00:00:00 2001 From: "marko.tikvic" Date: Mon, 11 Feb 2019 12:32:42 +0100 Subject: [PATCH] printing and tracing --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index a968379..4bdc22d 100644 --- a/main.go +++ b/main.go @@ -116,13 +116,18 @@ func (l *Logger) CombineHTTPLogs(in string, out string) { l.outputFile.WriteString(msg) } -func (l *Logger) Print(format string, v ...interface{}) { +func (l *Logger) PrintTrace(format string, v ...interface{}) { _, file, line, _ := runtime.Caller(1) msg := fmt.Sprintf(format, v...) fmt.Printf("%s: %s %d: %s\n", time.Now().Format(time.RFC3339), file, line, msg) } +func (l *Logger) Print(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + fmt.Printf("%s: %s\n", time.Now().Format(time.RFC3339), msg) +} + func (l *Logger) Trace(format string, v ...interface{}) { if l.outputFile == nil { return -- 1.8.1.2