Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log('setLevel(debug)')
tracer.setLevel('debug');
hello();
bb.hi()
console.log('close all')
tracer.close();
hello();
bb.hi()
console.log('setLevel(0) log')
tracer.setLevel(0);
hello();
bb.hi()
function hello() {
logger.log('hello');
logger.trace('hello', 'world');
logger.debug('hello %s', 'world', 123);
logger.warn('hello %s', 'world', 123);
logger.error('hello %s', 'world', 123);
}
console.log('ALL default Level')
hello();
bb.hi()
console.log('setLevel(debug)')
tracer.setLevel('debug');
hello();
bb.hi()
console.log('close all')
tracer.close();
hello();
bb.hi()
console.log('setLevel(0) log')
tracer.setLevel(0);
hello();
bb.hi()
logger.setLevel = (level: Level) => {
tracer.setLevel(level);
};
module.exports.setLevel = level => {
tracer.setLevel(level);
};
daemon({ cwd: process.cwd() })
fs.writeFileSync(pidFile, process.pid, 'utf8')
}
let logger
if (program.daemon) {
logger = tracer.dailyfile({
root: path.join(baseDir, 'logs'),
maxLogFiles: 10,
allLogsFileName: 'debug',
dateformat: 'yyyy-mm-dd HH:MM:ss.L'
})
} else {
logger = tracer.colorConsole({ dateformat: 'yyyy-mm-dd HH:MM:ss.L' })
}
tracer.setLevel(appConfig.logLevel)
const options = {
appConfig,
genesisblock,
logger,
pidFile,
}
const app = new Application(options)
app.run()
}