You've already forked factorio-server-manager
mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2026-06-19 20:06:55 +02:00
Added option to select a file for chat-logs (#310)
This commit is contained in:
@@ -62,7 +62,8 @@ type Config struct {
|
||||
Autostart string `json:"-"`
|
||||
ConsoleCacheSize int `json:"console_cache_size,omitempty"` // the amount of cached lines, inside the factorio output cache
|
||||
ConsoleLogFile string `json:"console_log_file,omitempty"`
|
||||
Secure bool `json:"secure"` // set to `false` to use this tool without SSL/TLS (Default: `true`)
|
||||
ChatLogFile string `json:"chat_log_file,omitempty"` // separate log file for chat (incl join/quit)
|
||||
Secure bool `json:"secure"` // set to `false` to use this tool without SSL/TLS (Default: `true`)
|
||||
}
|
||||
|
||||
// set Configs default values. JSON unmarshal will replace when it found something different
|
||||
|
||||
@@ -273,6 +273,11 @@ func (server *Server) Run() error {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user