mirror of
https://github.com/MedzikUser/go-github-selfupdate.git
synced 2024-08-15 03:25:29 +00:00
do not calculate header of log when disabled
This commit is contained in:
parent
79d641a2f6
commit
f44b3ad7b4
1 changed files with 3 additions and 1 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
var log = stdlog.New(ioutil.Discard, "", stdlog.Ltime)
|
||||
var log = stdlog.New(ioutil.Discard, "", 0)
|
||||
var logEnabled = false
|
||||
|
||||
// EnableLog enables to output logging messages in library
|
||||
|
@ -16,6 +16,7 @@ func EnableLog() {
|
|||
}
|
||||
logEnabled = true
|
||||
log.SetOutput(os.Stderr)
|
||||
log.SetFlags(stdlog.Ltime)
|
||||
}
|
||||
|
||||
// DisableLog disables to output logging messages in library
|
||||
|
@ -25,4 +26,5 @@ func DisableLog() {
|
|||
}
|
||||
logEnabled = false
|
||||
log.SetOutput(ioutil.Discard)
|
||||
log.SetFlags(0)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue