UNPKG

quickbuild

Version:

A mature, feature-complete application generator with an emphasis on speed

19 lines (14 loc) 484 B
import winston from "winston"; const options: winston.LoggerOptions = { transports: [ new winston.transports.Console({ level: process.env.NODE_ENV === "production" ? "error" : "debug" }), new winston.transports.File({ filename: "debug.log", level: "debug" }) ] }; const logger = winston.createLogger(options); if (process.env.NODE_ENV !== "production") { logger.debug("Logging initialized at debug level"); } export default logger;