Skip to content

Commit

Permalink
logger.ironsmile: correctly setup loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Oct 6, 2015
1 parent 2310b20 commit 415b3e0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions logger/ironsmile/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,24 @@ func New(cfg *config.Logger) (*logger.Logger, error) {
return nil, fmt.Errorf("error while opening file [%s] for log output: %s",
s.LogFile, err)
}
l.SetLogOutput(logOutput)
} else if debugOutput != nil {
l.SetLogOutput(debugOutput)
logOutput = debugOutput
}

if logOutput != nil {
l.SetLogOutput(logOutput)
}
if s.ErrorFile != "" {
errorOutput, err = os.OpenFile(s.ErrorFile, logFileFlags, logFilePerms)
if err != nil {
return nil, fmt.Errorf("Error while opening file [%s] for error output: %s",
s.ErrorFile, err)
}
l.SetErrorOutput(errorOutput)
} else if logOutput != nil {
l.SetErrorOutput(logOutput)
errorOutput = logOutput
}
if errorOutput != nil {
l.SetErrorOutput(errorOutput)
}

if debugOutput != nil {
Expand Down

0 comments on commit 415b3e0

Please sign in to comment.