Fixed custom chat log option (#313)

Server was started before the `--console-log` option as added to the arguments.
This commit is contained in:
Matthijs
2022-03-14 22:51:16 +01:00
committed by GitHub
parent 2a74e1229f
commit 02d286be36
+6 -6
View File
@@ -265,6 +265,11 @@ func (server *Server) Run() error {
} else {
args = append(args, "--start-server", filepath.Join(config.FactorioSavesDir, server.Savefile))
}
// Write chat log to a different file if requested (if not it will be mixed-in with the default logfile)
if config.ChatLogFile != "" {
args = append(args, "--console-log", config.ChatLogFile)
}
if config.GlibcCustom == "true" {
log.Println("Starting server with command: ", config.GlibcLocation, args)
@@ -273,12 +278,7 @@ func (server *Server) Run() error {
log.Println("Starting server with command: ", config.FactorioBinary, args)
server.Cmd = exec.Command(config.FactorioBinary, args...)
}
// Write chat log to a different file if requested (if not it will be mixed-in with the default logfile)
if config.ChatLogFile != "" {
args = append(args, "--console-log", config.ChatLogFile)
}
server.StdOut, err = server.Cmd.StdoutPipe()
if err != nil {
log.Printf("Error opening stdout pipe: %s", err)