ensure only one logger is ever created

This commit is contained in:
richardsonjack 2018-05-30 12:45:37 +09:30
parent 90288f546a
commit 369beab55c
1 changed files with 6 additions and 6 deletions

View File

@ -241,12 +241,12 @@ func main() {
config.Timeout = *configFlags[timeoutPtr]
config.IntraRefreshPeriod = *configFlags[intraRefreshPeriodPtr]
// Also give the config a logger object
config.Logger = smartlogger.New(loggerVerbosity, smartlogger.File, "/var/log/netsender/")
//init netsender
if *netSenderFlagPtr {
netsenderInit()
} else {
// Also give the config a logger object
config.Logger = smartlogger.New(loggerVerbosity, smartlogger.File, "/var/log/netsender/")
}
time.Sleep(time.Duration(prepTime) * time.Second)