From 6d2ab00fa7d7c5bf968cc08bfe19486746e48dfb Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 1 Nov 2025 00:21:37 +0100 Subject: [PATCH] mod: revert changes Logging will be done through `zlog` dependency for *zig* based applications. `zlog` shall be configured such that it should not log to *stderr* and should use the "log" file instead. This way the log file is both used by `serve` and by the running application. Logging could also happen in a different file and is independent of the logging of `serve`, however for now I want the logging to also happen in the same file. --- internal/serve/serve.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/serve/serve.go b/internal/serve/serve.go index 60202f1..119fe8f 100644 --- a/internal/serve/serve.go +++ b/internal/serve/serve.go @@ -56,11 +56,6 @@ func setupSshServer(host string, port string, host_key_path string, users map[st func(next ssh.Handler) ssh.Handler { return func(s ssh.Session) { cmd := wish.Command(s, name, args...) - file, err := os.OpenFile("log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600) - if err != nil { - wish.Fatalln(s, err) - } - cmd.SetStderr(file) if err := cmd.Run(); err != nil { wish.Fatalln(s, err) } @@ -76,9 +71,6 @@ func setupSshServer(host string, port string, host_key_path string, users map[st // Serve an ssh application using the provided arguments. func Serve(host string, port string, host_key_path string, users map[string]string, name string, args []string) { setupLogging() - log.Info("Running Serve (v2.8)...") // TODO make version string automatically the git tag (otherwise commit-hash)? - defer log.Info("Stopping Serve...") - srv, err := setupSshServer(host, port, host_key_path, users, name, args) if err != nil { log.Error("Could not start server", "error", err)