code-server/packages/logger/src/logger.test.ts

17 lines
619 B
TypeScript
Raw Normal View History

2019-01-08 07:46:19 +07: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");
});
});