mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-08 04:04:53 +02:00
commit
7a1e2d3dff
@ -264,7 +264,7 @@ func (f *FactorioServer) parseRunningCommand(std io.ReadCloser) (err error) {
|
||||
}
|
||||
|
||||
func (f *FactorioServer) writeLog(logline string) error {
|
||||
logfileName := config.FactorioDir + "factorio-server-console.log"
|
||||
logfileName := filepath.Join(config.FactorioDir, "factorio-server-console.log")
|
||||
file, err := os.OpenFile(logfileName, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
log.Printf("Cannot open logfile for appending Factorio Server output: %s", err)
|
||||
|
@ -2,13 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/hpcloud/tail"
|
||||
)
|
||||
|
||||
func logSubscribe(client *Client, data interface{}) {
|
||||
go func() {
|
||||
logfile := config.FactorioDir + "factorio-server-console.log"
|
||||
logfile := filepath.Join(config.FactorioDir, "factorio-server-console.log")
|
||||
t, err := tail.TailFile(logfile, tail.Config{Follow: true})
|
||||
if err != nil {
|
||||
log.Printf("Error subscribing to tail log %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user