Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function getLog(context) {
if(!context){
const filePath = callerCallsite().getFileName();
context = path.basename(filePath);
}
const logger = new winston.Logger({
transports: [
new (winston.transports.Console)({
level: config.logging.consoleLogLevel,
handleExceptions: true,
json: false,
colorize: true,
formatter: (options)=>{
return formatLogMessage(options, context);
}
}),