v2: 'log' directive for Caddyfile, and debug mode (#3052)

* httpcaddyfile: Begin implementing log directive, and debug mode

For now, debug mode just sets the log level for all logs to DEBUG
(unless a level is specified explicitly).

* httpcaddyfile: Finish 'log' directive

Also rename StringEncoder -> SingleFieldEncoder

* Fix minor bug in replacer (when vals are empty)
This commit is contained in:
Matt Holt
2020-02-25 22:00:33 -07:00
committed by GitHub
parent f6b9cb7122
commit 5d97522d18
9 changed files with 428 additions and 21 deletions

View File

@ -67,6 +67,11 @@ func TestReplacer(t *testing.T) {
input: `{{}`,
expect: "",
},
{
input: `{unknown}`,
empty: "-",
expect: "-",
},
} {
actual := rep.ReplaceAll(tc.input, tc.empty)
if actual != tc.expect {