diff options
Diffstat (limited to 'std/log/handlers_test.ts')
-rw-r--r-- | std/log/handlers_test.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/std/log/handlers_test.ts b/std/log/handlers_test.ts index 7ff4c4c90..ef4b69000 100644 --- a/std/log/handlers_test.ts +++ b/std/log/handlers_test.ts @@ -94,6 +94,23 @@ Deno.test("testFormatterAsString", function (): void { assertEquals(handler.messages, ["test DEBUG Hello, world!"]); }); +Deno.test("testFormatterWithEmptyMsg", function () { + const handler = new TestHandler("DEBUG", { + formatter: "test {levelName} {msg}", + }); + + handler.handle( + new LogRecord({ + msg: "", + args: [], + level: LogLevels.DEBUG, + loggerName: "default", + }) + ); + + assertEquals(handler.messages, ["test DEBUG "]); +}); + Deno.test("testFormatterAsFunction", function (): void { const handler = new TestHandler("DEBUG", { formatter: (logRecord): string => |