swaf/src/Logger.ts

12 lines
247 B
TypeScript
Raw Normal View History

2020-04-22 15:52:17 +02:00
import {v4 as uuid} from "uuid";
import {Logger as TsLogger} from "tslog";
2020-04-22 15:52:17 +02:00
export const log = new TsLogger();
2020-04-22 15:52:17 +02:00
export function makeUniqueLogger(): TsLogger {
const id = uuid();
return log.getChildLogger({
requestId: id,
});
2020-04-22 15:52:17 +02:00
}