aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 15:59:53 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 15:59:53 +0200
commit99c5ba31e854ae25e4990313096f818b7e0367da (patch)
tree22f5340a84c931152fa8a82c51e533b982294070 /internal
parent00e697170723d8eb82b2348f6dcb902435c40483 (diff)
downloadfeed2imap-go-99c5ba31e854ae25e4990313096f818b7e0367da.tar.gz
feed2imap-go-99c5ba31e854ae25e4990313096f818b7e0367da.tar.bz2
feed2imap-go-99c5ba31e854ae25e4990313096f818b7e0367da.zip
Use our own logger for debug for convenience sake
Diffstat (limited to 'internal')
-rw-r--r--internal/log/log.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/log/log.go b/internal/log/log.go
index d25ea8e..0238c7e 100644
--- a/internal/log/log.go
+++ b/internal/log/log.go
@@ -6,6 +6,7 @@ import (
"os"
)
+var debugLogger = log.New(os.Stdout, "", log.LstdFlags)
var errorLogger = log.New(os.Stderr, "ERROR ", log.LstdFlags|log.Lmsgprefix)
var warnLogger = log.New(os.Stdout, "WARN ", log.LstdFlags|log.Lmsgprefix)
var enableDebug = false
@@ -16,13 +17,13 @@ func SetDebug(state bool) {
func Print(v ...interface{}) {
if enableDebug {
- _ = log.Output(2, fmt.Sprint(v...))
+ _ = debugLogger.Output(2, fmt.Sprint(v...))
}
}
func Printf(format string, v ...interface{}) {
if enableDebug {
- _ = log.Output(2, fmt.Sprintf(format, v...))
+ _ = debugLogger.Output(2, fmt.Sprintf(format, v...))
}
}