summaryrefslogtreecommitdiffstats
path: root/roseh.moe.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2026-10-01 19:03:41 -0700
committerRose Hogenson <rosehogenson@posteo.net>2026-10-01 19:04:01 -0700
commitcf562d7f52038e5ce00d346d2f1826a442979e84 (patch)
treedbe2a02c265e17d189e619a1490d5f4b7a82fb1c /roseh.moe.go
parentAdd back logging again (diff)
downloadroseh.moe-cf562d7f52038e5ce00d346d2f1826a442979e84.tar.zst
Logging behind a flag
Diffstat (limited to 'roseh.moe.go')
-rw-r--r--roseh.moe.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index 5f24664..ecc4b50 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -53,6 +53,7 @@ var (
nezuko = flag.String("nezuko", "/mnt/nezuko", "nezuko partition")
cgit = flag.String("cgit", "", "directory containing cgit.cgi")
cgitConfig = flag.String("cgit-config", "", "cgit config file")
+ v = flag.Bool("v", true, "verbose")
)
type urlValue struct {
@@ -1212,8 +1213,12 @@ func main() {
cgitCGI.PathLocationHandler = cgitCGI
codeMux.Handle("/", &timeoutHandler{h: cgitCGI, timeout: 5 * time.Minute})
serverMux.Handle("code."+selfURL.Hostname()+"/", &gzipHandler{codeMux})
+ var handler http.Handler = serverMux
+ if *v {
+ handler = &loggingHandler{serverMux}
+ }
server := &http.Server{
- Handler: &loggingHandler{serverMux},
+ Handler: handler,
ReadHeaderTimeout: 5 * time.Minute,
IdleTimeout: 10 * time.Minute,