mirror of
https://gitea.phreedom.club/localhost_frssoft/mastodon-group-bot.git
synced 2024-11-22 12:29:20 +02:00
fix logging
This commit is contained in:
parent
6c718b73ae
commit
262a480ffe
2
bot.go
2
bot.go
|
@ -24,8 +24,6 @@ var (
|
|||
)
|
||||
|
||||
func RunBot() {
|
||||
LoggerInit()
|
||||
|
||||
events, err := c.StreamingUser(ctx)
|
||||
if err != nil {
|
||||
ErrorLogger.Println("Streaming")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
@ -16,7 +17,7 @@ func LoggerInit() {
|
|||
if err != nil {
|
||||
log.Fatal("Failed to read log file")
|
||||
}
|
||||
InfoLogger = log.New(file, "[INFO] ", log.LstdFlags|log.Lshortfile)
|
||||
WarnLogger = log.New(file, "[WARNING] ", log.LstdFlags|log.Lshortfile)
|
||||
ErrorLogger = log.New(file, "[ERROR] ", log.LstdFlags|log.Lshortfile)
|
||||
InfoLogger = log.New(io.MultiWriter(os.Stdout, file), "[INFO] ", log.LstdFlags|log.Lshortfile)
|
||||
WarnLogger = log.New(io.MultiWriter(os.Stdout, file), "[WARNING] ", log.LstdFlags|log.Lshortfile)
|
||||
ErrorLogger = log.New(io.MultiWriter(os.Stdout, file), "[ERROR] ", log.LstdFlags|log.Lshortfile)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue