Commit 81ae25d9 by mawei

Find log issue

parent 05cf879a
......@@ -9,7 +9,7 @@ class DI {
}
static getLogger() {
const level = process.env.NODE_LOG_LEVEL || 'error';
const level = process.env.NODE_LOG_LEVEL || 'info';
log4js.configure({
appenders: {
console: { type: 'console' },
......
......@@ -11,19 +11,38 @@ const config = require('config');
async function t () {
return 't';
}
const DI = require('./lib/DI');
const logger = DI.getLogger();
// new Buffer('hnmz147852.').toString('base64')
// new Buffer('Q2hlY2hlbmcyMzUj', 'base64').toString();
let i = 0;
async function test (l) {
i += 1;
await Promise.delay(l*1000).then(async function() {
console.log('过了' + l + '秒');
console.log((new Date()).toLocaleString());
console.log('=======================================');
logger.info('过了' + l + '秒');
logger.info((new Date()).toLocaleString());
logger.info('=======================================');
if (i < 8) {
test(1);
} else {
return true;
}
});
}
(async () => {
await test(1).then(async () => {
await DI.shutdownLogger(async () => {
console.log('牛逼啊');
});
});
return;
const mt = await t();
console.log(mt);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment