made htmx logging a flag that can be toggled
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user