0
0
Fork 0
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:
Marcos Casagrande 2020-05-20 16:27:01 +02:00 committed by GitHub
parent 8799855fdc
commit 7566aa8765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -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
View 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);
});