egg-logrotator
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -6,2 +6,3 @@ 'use strict'; | ||
const fs = require('mz/fs'); | ||
const debug = require('debug')('egg-logrotator:day_rotator'); | ||
const Rotator = require('./rotator'); | ||
@@ -73,2 +74,3 @@ | ||
const targetPath = srcPath + moment().subtract(1, 'days').format('.YYYY-MM-DD'); | ||
debug('set file %s => %s', srcPath, targetPath); | ||
files.set(srcPath, { srcPath, targetPath }); | ||
@@ -75,0 +77,0 @@ } |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const fs = require('mz/fs'); | ||
const debug = require('debug')('egg-logrotator:hour_rotator'); | ||
const Rotator = require('./rotator'); | ||
@@ -31,2 +32,3 @@ | ||
const targetPath = srcPath + moment().subtract(1, 'hours').format('.YYYY-MM-DD-HH'); | ||
debug('set file %s => %s', srcPath, targetPath); | ||
files.set(srcPath, { srcPath, targetPath }); | ||
@@ -33,0 +35,0 @@ } |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const fs = require('mz/fs'); | ||
const debug = require('debug')('egg-logrotator:rotator'); | ||
@@ -27,3 +28,3 @@ | ||
try { | ||
this.logger.debug('rename from %s to %s', file.srcPath, file.targetPath); | ||
debug('rename from %s to %s', file.srcPath, file.targetPath); | ||
yield renameOrDelete(file.srcPath, file.targetPath); | ||
@@ -30,0 +31,0 @@ rotatedFile.push(`${file.srcPath} -> ${file.targetPath}`); |
'use strict'; | ||
const fs = require('mz/fs'); | ||
const debug = require('debug')('egg-logrotator:size_rotator'); | ||
const Rotator = require('./rotator'); | ||
@@ -52,5 +53,7 @@ | ||
const targetPath = `${logPath}.${i + 1}`; | ||
debug('set file %s => %s', srcPath, targetPath); | ||
files.set(srcPath, { srcPath, targetPath }); | ||
} | ||
// foo.log -> foo.log.1 | ||
debug('set file %s => %s', logPath, `${logPath}.1`); | ||
files.set(logPath, { srcPath: logPath, targetPath: `${logPath}.1` }); | ||
@@ -57,0 +60,0 @@ } |
2.2.3 / 2017-06-04 | ||
================== | ||
* docs: fix License url (#10) | ||
* chore: upgrade deps and fix test (#9) | ||
2.2.2 / 2016-10-27 | ||
@@ -3,0 +9,0 @@ ================== |
{ | ||
"name": "egg-logrotator", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "logrotator for egg", | ||
@@ -16,4 +16,5 @@ "eggPlugin": { | ||
"dependencies": { | ||
"moment": "^2.14.1", | ||
"mz": "^2.4.0" | ||
"debug": "^2.6.0", | ||
"moment": "^2.17.1", | ||
"mz": "^2.6.0" | ||
}, | ||
@@ -27,23 +28,21 @@ "files": [ | ||
"devDependencies": { | ||
"autod": "^2.7.0", | ||
"egg": "test", | ||
"egg-bin": "^1.2.0", | ||
"egg-ci": "^1.0.3", | ||
"egg-mock": "^0.0.4", | ||
"eslint": "^3.3.1", | ||
"eslint-config-egg": "^3.1.0", | ||
"glob": "^7.0.5", | ||
"intelli-espower-loader": "^1.0.1", | ||
"autod": "^2.7.1", | ||
"egg": "^0.9.0", | ||
"egg-bin": "^2.0.2", | ||
"egg-ci": "^1.1.0", | ||
"egg-mock": "^2.3.1", | ||
"eslint": "^3.14.1", | ||
"eslint-config-egg": "^3.2.0", | ||
"glob": "^7.1.1", | ||
"pedding": "1", | ||
"power-assert": "^1.4.1", | ||
"supertest": "^2.0.0" | ||
"supertest": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
}, | ||
"scripts": { | ||
"test": "npm run lint && npm run test-local", | ||
"test-local": "egg-bin test -r intelli-espower-loader", | ||
"cov": "egg-bin cov -r intelli-espower-loader", | ||
"lint": "eslint --ext js --fix test app config *.js", | ||
"lint": "eslint .", | ||
"test": "npm run lint -- --fix && npm run test-local", | ||
"test-local": "egg-bin test", | ||
"cov": "egg-bin cov", | ||
"ci": "npm run lint && npm run cov", | ||
@@ -53,3 +52,3 @@ "autod": "autod" | ||
"ci": { | ||
"version": "4, 6" | ||
"version": "6, 7" | ||
}, | ||
@@ -56,0 +55,0 @@ "repository": { |
@@ -119,2 +119,3 @@ # egg-logrotator | ||
[MIT](LICENSE) | ||
[MIT](https://github.com/eggjs/egg-logrotator/blob/master/LICENSE) | ||
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
18833
10
355
121
3
+ Addeddebug@^2.6.0
+ Addeddebug@2.6.9(transitive)
+ Addedms@2.0.0(transitive)
Updatedmoment@^2.17.1
Updatedmz@^2.6.0