No tarball for gmail

This commit is contained in:
2022-07-24 22:33:35 -04:00
commit 16c9043bd0
13 changed files with 4394 additions and 0 deletions

25
logger/index.js Normal file
View File

@@ -0,0 +1,25 @@
import winston from "winston";
export default function ({
service = "pubsub",
postfix = "",
level = "info",
} = {}) {
return winston.createLogger({
level,
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
),
defaultMeta: { service: `${service}:${postfix}` },
transports: [new winston.transports.Console()],
});
}
//Gets logger's level from CLI input, defaults to 'info'
export function getLevel(num) {
const [logLevel] = Object.entries(winston.config.npm.levels)
.filter(([name, value]) => value === num)
.shift() || ["info"];
return logLevel;
}