You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
403 B
16 lines
403 B
const _ = require("lodash/fp");
|
|
const winston = require("winston");
|
|
|
|
module.exports = {
|
|
getEnv: (envName, defaultValue = undefined) =>
|
|
_.getOr(defaultValue, envName)(process.env),
|
|
|
|
getLogger: (verbose = true) => {
|
|
return winston.createLogger({
|
|
level: verbose ? "debug" : "info",
|
|
format: winston.format.cli(),
|
|
transports: [new winston.transports.Console()],
|
|
});
|
|
},
|
|
};
|