mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
fix logging when flag is passed on command line
This commit is contained in:
parent
2d57c00df7
commit
c9ae47fe01
1 changed files with 9 additions and 5 deletions
|
@ -92,11 +92,15 @@ func setupLogging() {
|
|||
log.SetLogLevel(log.INFO)
|
||||
}
|
||||
|
||||
if logFile != "" {
|
||||
log.Close()
|
||||
if err := log.OpenFile(logFile); err != nil {
|
||||
log.Error("Error opening user defined log: %s %s", logFile, err)
|
||||
}
|
||||
var logFileToUse string
|
||||
if logFile == "" {
|
||||
logFileToUse = log.StdoutFile
|
||||
} else {
|
||||
logFileToUse = logFile
|
||||
}
|
||||
log.Close()
|
||||
if err := log.OpenFile(logFileToUse); err != nil {
|
||||
log.Error("Error opening user defined log: %s %s", logFileToUse, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue