docs: bare levels in the example configs
Assisted-by: GLM-5.3 via pi
change svznmrzknpovtpqlqnqlntprknuuzzsv
commit e54e20d3185d1ba440be6260566c953579033235
author Alpha Chen <alpha@kejadlen.dev>
date
parent ukrssprq
diff --git a/README.md b/README.md
index 799251e..31a7e26 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ from the file named by `--config` or `DOCKET_CONFIG`:
 ```kdl
 bind "127.0.0.1:3000"
 database "docket.db"
+log warn
 credential "household" token-file="/run/credentials/docket/household"
 ```
 
@@ -43,7 +44,7 @@ credential "household" token-file="/run/credentials/docket/household"
 |---|---|---|
 | `bind` | `127.0.0.1:3000` | Address to listen on. |
 | `database` | `docket.db` | SQLite database file, created if missing. |
-| `log` | `warn` | Log level for the app, with optional per-target overrides as properties: `log "debug" hyper="warn"`. |
+| `log` | `warn` | Log level for the app, with optional per-target overrides as properties: `log debug hyper=warn`. |
 | `credential` | None | A Fastmail API token to sync mail with. Repeat it once per login. |
 
 Each `credential` takes a name, which becomes the account's slug, and a
diff --git a/docket.kdl b/docket.kdl
index 3c2b994..9eb37f5 100644
--- a/docket.kdl
+++ b/docket.kdl
@@ -4,7 +4,7 @@
 // first time and stands in for Tailscale. Delete docket.db to start over.
 bind "127.0.0.1:3000"
 database "docket.db"
-// log "warn"
+// log warn
 
 // A Fastmail API token per login (ADR 1). The name is the account's slug;
 // the token lives in the named file, never in this config. Local dev runs
diff --git a/fly.kdl b/fly.kdl
index 4c711f2..37ab084 100644
--- a/fly.kdl
+++ b/fly.kdl
@@ -8,4 +8,4 @@
 // replaces, so each deploy starts from the fixtures again.
 bind "0.0.0.0:3000"
 database "/tmp/docket.db"
-log "info"
+log info
diff --git a/src/bin/docket/config.rs b/src/bin/docket/config.rs
index 43451fc..2d0881d 100644
--- a/src/bin/docket/config.rs
+++ b/src/bin/docket/config.rs
@@ -215,11 +215,14 @@ mod tests {
 
     #[test]
     fn log_takes_a_level_with_target_overrides() {
-        let config = parse(r#"log "debug" hyper="warn""#).unwrap();
-        let expected = Targets::new()
-            .with_default(LevelFilter::DEBUG)
-            .with_target("hyper", LevelFilter::WARN);
-        assert_eq!(config.log, expected);
+        // Levels and targets parse bare; quoting them stays legal.
+        for source in [r#"log "debug" hyper="warn""#, "log debug hyper=warn"] {
+            let config = parse(source).unwrap();
+            let expected = Targets::new()
+                .with_default(LevelFilter::DEBUG)
+                .with_target("hyper", LevelFilter::WARN);
+            assert_eq!(config.log, expected);
+        }
     }
 
     #[test]