|
|
|
@ -52,6 +52,9 @@ var createLogType = function (ctx, type) {
|
|
|
|
|
return noop;
|
|
|
|
|
}
|
|
|
|
|
return function (tag, info) {
|
|
|
|
|
if (ctx.shutdown) {
|
|
|
|
|
throw new Error("Logger has been shut down!");
|
|
|
|
|
}
|
|
|
|
|
var time = new Date().toISOString();
|
|
|
|
|
var content;
|
|
|
|
|
try {
|
|
|
|
@ -98,7 +101,13 @@ Logger.create = function (config, cb) {
|
|
|
|
|
filePath: config.logPath,
|
|
|
|
|
}, function (store) {
|
|
|
|
|
ctx.store = store;
|
|
|
|
|
cb(Object.freeze(createMethods(ctx)));
|
|
|
|
|
var logger = createMethods(ctx);
|
|
|
|
|
logger.shutdown = function () {
|
|
|
|
|
delete ctx.store;
|
|
|
|
|
ctx.shutdown = true;
|
|
|
|
|
store.shutdown();
|
|
|
|
|
};
|
|
|
|
|
cb(Object.freeze(logger));
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|