UNPKG

evm-watcher

Version:

Fault tolerant event watcher for topics on the ethereum virtual machine.

24 lines (23 loc) 904 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const winston_1 = tslib_1.__importDefault(require("winston")); const { combine, timestamp, printf } = winston_1.default.format; const rTracerFormat = printf((info) => { return `${info.timestamp} [${info.level}]: ${info.message}`; }); /* istanbul ignore next */ // Not worth testing a logger. const logger = winston_1.default.createLogger({ format: combine(timestamp(), rTracerFormat), transports: [ new winston_1.default.transports.Console({ level: process.env.WATCHER_LOG_LEVEL || "verbose", silent: process.env.NODE_ENV === "test", }), ], }); /* istanbul ignore next */ // Not worth testing a PROD config. if (process.env.NODE_ENV !== "production") { logger.debug("Logging initialized at debug level"); } exports.default = logger;