1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-06 16:58:44 +00:00
code-server-2/packages/logger/src/logger.test.ts

17 lines
619 B
TypeScript
Raw Normal View History

2019-01-08 00:46:19 +00:00
import { field, logger, BrowserFormatter, Time } from "./logger";
describe("Logger", () => {
it("should use server formatter", () => {
logger.info("test", field("key", "value"), field("time", new Time(100, Date.now())));
logger.named("name").debug("test name");
logger.named("another name").warn("another test name");
});
it("should use browser formatter", () => {
logger.formatter = new BrowserFormatter();
logger.info("test", field("key", "value"), field("time", new Time(100, Date.now())));
logger.named("name").debug("test name");
logger.named("another name").warn("another test name");
});
});