Compare commits

..

1 Commits

Author SHA1 Message Date
80fbd915ed Use winston for logging 2021-03-14 21:14:44 -06:00

View File

@ -1,10 +1,11 @@
import PhoneNumber from "awesome-phonenumber"; import PhoneNumber from "awesome-phonenumber";
import winston from "winston"; import winston, { format } from "winston";
export const DEBUG = !!process.env.DEBUG; export const DEBUG = !!process.env.DEBUG;
export const logger = winston.createLogger({ export const logger = winston.createLogger({
level: DEBUG ? "debug" : process.env.LOG_LEVEL ?? "info", level: DEBUG ? "debug" : process.env.LOG_LEVEL ?? "info",
transports: [new winston.transports.Console()], transports: [new winston.transports.Console()],
format: format.printf(({ level, message }) => `${level}: ${message}`),
}); });
export function getNationalNumber(input: string) { export function getNationalNumber(input: string) {