mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
fix(std/log): await default logger setup (#5341)
This commit is contained in:
parent
8799855fdc
commit
7566aa8765
2 changed files with 17 additions and 1 deletions
|
@ -127,4 +127,4 @@ export async function setup(config: LogConfig): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
setup(DEFAULT_CONFIG);
|
||||
await setup(DEFAULT_CONFIG);
|
||||
|
|
16
std/log/mod_test.ts
Normal file
16
std/log/mod_test.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
const { test } = Deno;
|
||||
import { Logger } from "./logger.ts";
|
||||
import { assert } from "../testing/asserts.ts";
|
||||
import { getLogger } from "./mod.ts";
|
||||
|
||||
let logger: Logger | null = null;
|
||||
try {
|
||||
// Need to initialize it here
|
||||
// otherwise it will be already initialized on Deno.test
|
||||
logger = getLogger();
|
||||
} catch {}
|
||||
|
||||
test("logger is initialized", function (): void {
|
||||
assert(logger instanceof Logger);
|
||||
});
|
Loading…
Add table
Reference in a new issue