code-server/packages/logger/src/logger.test.ts
2019-02-05 11:15:42 -06:00

17 lines
619 B
TypeScript

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");
});
});