Select the types of activity you want to include in your feed.
chore: better logging options in dev mode
Previously in dev mode, logs went to stdout even if you had specified a file to log to. Now if you specify a file, we'll not send them to stdout as well.
···44 "context"
55 "io"
66 "io/fs"
77+ "log"
78 "log/slog"
89 "net/http"
910 "os"
···8081 defer f.Close()
8182 output = f
8283 }
8484+ }
8585+8686+ // Redirect standard log library to the same output
8787+ // This captures logs from libraries or legacy code (like irclink.go)
8888+ // preventing them from leaking to stdout/stderr if a file is configured.
8989+ // We only do this if we aren't writing to stdout/stderr to match expected behavior
9090+ // of "if log file is specified, do not output to stdout"
9191+ if cfg.Mode == "development" || cfg.Mode == "dev" {
9292+ // If we are in dev mode and have a specific file output, we force standard log to that file too
9393+ // If output is already stdout/stderr, this is a no-op effectively
9494+ log.SetOutput(output)
9595+ } else {
9696+ // In production/other modes, we also likely want to capture standard logs into our structured log stream
9797+ // or at least to the same destination.
9898+ log.SetOutput(output)
8399 }
8410085101 var level slog.Level