Skip to content
Snippets Groups Projects
Commit 5ec2367c authored by Дмитрий Цирульников's avatar Дмитрий Цирульников
Browse files

up

parent 7e7fa83a
No related branches found
Tags v0.2.7
No related merge requests found
......@@ -16,15 +16,17 @@ func Init(path string) {
func GetLogOutput(path string) io.Writer {
if path != "" {
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
fmt.Println("open log file")
if err != nil {
fmt.Println("log file error: ", err)
return os.Stdout
}
defer f.Close()
mw := io.MultiWriter(f, os.Stdout)
return mw
return io.MultiWriter(os.Stdout, f)
}
fmt.Println("log file not found")
return os.Stdout
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment