egg-logger
Advanced tools
Comparing version 2.2.1 to 2.3.0
2.3.0 / 2019-01-01 | ||
================== | ||
**features** | ||
* [[`22cf355`](http://github.com/eggjs/egg-logger/commit/22cf355d7ae976c8502745a8e8d73748af885637)] - feat: file path support relative path (#41) (TZ | 天猪 <<atian25@qq.com>>) | ||
**others** | ||
* [[`0262ac2`](http://github.com/eggjs/egg-logger/commit/0262ac204826f1a582bd63273a43cfe86c723ad3)] - chore: fix typo (#40) (Jeff <<jeff.tian@outlook.com>>) | ||
2.2.1 / 2018-12-26 | ||
@@ -3,0 +12,0 @@ ================== |
'use strict'; | ||
const path = require('path'); | ||
const Logger = require('../logger'); | ||
@@ -17,3 +18,4 @@ const utils = require('../utils'); | ||
* @param {Object} options | ||
* - {String} file - log file | ||
* - {String} dir - log base dir | ||
* - {String} file - log file, support relavie path | ||
* - {String} [encoding = utf8] - log string encoding | ||
@@ -32,2 +34,4 @@ * - {String} [level = INFO] - file log level | ||
if (!path.isAbsolute(this.options.file)) this.options.file = path.join(this.options.dir, this.options.file); | ||
if (this.options.outputJSON === true && this.options.file) { | ||
@@ -34,0 +38,0 @@ this.options.jsonFile = this.options.file.replace(/\.log$/, '.json.log'); |
'use strict'; | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
@@ -69,3 +68,3 @@ const debug = require('debug')('egg:logger'); | ||
const errorLogger = new ErrorLogger(utils.assign({}, loggerConfig, { | ||
file: path.join(loggerConfig.dir, loggerConfig.errorLogName), | ||
file: loggerConfig.errorLogName, | ||
})); | ||
@@ -76,3 +75,3 @@ this.set('errorLogger', errorLogger); | ||
const logger = new Logger(utils.assign({}, loggerConfig, { | ||
file: path.join(loggerConfig.dir, loggerConfig.agentLogName), | ||
file: loggerConfig.agentLogName, | ||
})); | ||
@@ -82,3 +81,3 @@ this.set('logger', logger); | ||
const coreLogger = new Logger(utils.assign({}, loggerConfig, loggerConfig.coreLogger, { | ||
file: path.join(loggerConfig.dir, loggerConfig.agentLogName), | ||
file: loggerConfig.agentLogName, | ||
})); | ||
@@ -88,3 +87,3 @@ this.set('coreLogger', coreLogger); | ||
const logger = new Logger(utils.assign({}, loggerConfig, { | ||
file: path.join(loggerConfig.dir, loggerConfig.appLogName), | ||
file: loggerConfig.appLogName, | ||
})); | ||
@@ -94,3 +93,3 @@ this.set('logger', logger); | ||
const coreLogger = new Logger(utils.assign({}, loggerConfig, loggerConfig.coreLogger, { | ||
file: path.join(loggerConfig.dir, loggerConfig.coreLogName), | ||
file: loggerConfig.coreLogName, | ||
})); | ||
@@ -97,0 +96,0 @@ this.set('coreLogger', coreLogger); |
@@ -14,3 +14,3 @@ 'use strict'; | ||
/** | ||
* ouput log into file {@link Transport}。 | ||
* output log into file {@link Transport}。 | ||
*/ | ||
@@ -52,3 +52,3 @@ class FileTransport extends Transport { | ||
* @param {Array} args - all arguments | ||
* @param {Object} meta - meta infomations | ||
* @param {Object} meta - meta information | ||
*/ | ||
@@ -55,0 +55,0 @@ log(level, args, meta) { |
@@ -60,3 +60,3 @@ 'use strict'; | ||
* | ||
* Invoke linke: {@Link Logger#log} -> {@link Transport#log} -> LoggerUtils.format | ||
* Invoke link: {@Link Logger#log} -> {@link Transport#log} -> LoggerUtils.format | ||
* @method LoggerUtils#format | ||
@@ -63,0 +63,0 @@ * @param {String} level - log level |
{ | ||
"name": "egg-logger", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "egg logger", | ||
@@ -20,6 +20,6 @@ "main": "index.js", | ||
"benchmark": "^2.1.4", | ||
"coffee": "^5.1.0", | ||
"egg-bin": "^1.11.1", | ||
"egg-ci": "^1.10.0", | ||
"eslint": "^5.9.0", | ||
"coffee": "^5.2.1", | ||
"egg-bin": "^4.9.0", | ||
"egg-ci": "^1.11.0", | ||
"eslint": "^5.11.1", | ||
"eslint-config-egg": "^7.1.0", | ||
@@ -30,2 +30,3 @@ "heapdump": "^0.3.12", | ||
"mm": "^2.4.1", | ||
"mz": "^2.7.0", | ||
"mz-modules": "^2.1.0", | ||
@@ -32,0 +33,0 @@ "rimraf": "^2.6.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47820
1219
20