made htmx logging a flag that can be toggled

This commit is contained in:
2026-01-24 16:55:36 +11:00
parent 038f8fd1a2
commit 3dc7cbe245
8 changed files with 50 additions and 14 deletions

View File

@@ -1,7 +1,19 @@
package contexts
import "context"
type Key string
func (c Key) String() string {
return "oslstats context key " + string(c)
}
var HTMXLogKey Key = Key("htmxlog")
func HTMXLog(ctx context.Context) bool {
htmxlog, ok := ctx.Value(HTMXLogKey).(bool)
if !ok {
return false
}
return htmxlog
}