egg-logger
Advanced tools
Comparing version 2.6.2 to 2.7.0
2.7.0 / 2021-12-05 | ||
================== | ||
**features** | ||
* [[`f42cb95`](http://github.com/eggjs/egg-logger/commit/f42cb950ab7e00872c464cff87e7b2b77da5c391)] - feat: support performance timer for more precise milliseconds (#74) (fengmk2 <<fengmk2@gmail.com>>) | ||
2.6.2 / 2021-08-02 | ||
@@ -3,0 +9,0 @@ ================== |
'use strict'; | ||
const { performance } = require('perf_hooks'); | ||
/** | ||
@@ -25,3 +27,8 @@ * Request context Logger, itself isn't a {@link Logger}. | ||
const traceId = ctx.tracer && ctx.tracer.traceId || '-'; | ||
const use = ctx.starttime ? Date.now() - ctx.starttime : 0; | ||
let use = 0; | ||
if (ctx.performanceStarttime) { | ||
use = Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000; | ||
} else if (ctx.starttime) { | ||
use = Date.now() - ctx.starttime; | ||
} | ||
return '[' + | ||
@@ -28,0 +35,0 @@ userId + '/' + |
@@ -22,3 +22,2 @@ 'use strict'; | ||
module.exports = { | ||
normalizeLevel(level) { | ||
@@ -25,0 +24,0 @@ if (typeof level === 'number') { |
{ | ||
"name": "egg-logger", | ||
"version": "2.6.2", | ||
"version": "2.7.0", | ||
"description": "egg logger", | ||
@@ -53,3 +53,3 @@ "main": "index.js", | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=8.5.0" | ||
}, | ||
@@ -62,6 +62,9 @@ "files": [ | ||
"ci": { | ||
"version": "8, 10, 12, 14", | ||
"type": "github" | ||
"version": "8, 10, 12, 14, 16", | ||
"type": "github", | ||
"os": { | ||
"github": "linux, macos" | ||
} | ||
}, | ||
"license": "MIT" | ||
} |
# egg-logger | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![build status][github-action-image]][github-action-url] | ||
[![Test coverage][codecov-image]][codecov-url] | ||
[![David deps][david-image]][david-url] | ||
[![Known Vulnerabilities][snyk-image]][snyk-url] | ||
@@ -12,8 +11,6 @@ [![npm download][download-image]][download-url] | ||
[npm-url]: https://npmjs.org/package/egg-logger | ||
[travis-image]: https://img.shields.io/travis/eggjs/egg-logger.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/eggjs/egg-logger | ||
[github-action-image]: https://github.com/eggjs/egg-logger/workflows/Node.js%20CI/badge.svg | ||
[github-action-url]: https://github.com/eggjs/egg-logger/actions | ||
[codecov-image]: https://codecov.io/github/eggjs/egg-logger/coverage.svg?branch=master | ||
[codecov-url]: https://codecov.io/github/eggjs/egg-logger?branch=master | ||
[david-image]: https://img.shields.io/david/eggjs/egg-logger.svg?style=flat-square | ||
[david-url]: https://david-dm.org/eggjs/egg-logger | ||
[snyk-image]: https://snyk.io/test/npm/egg-logger/badge.svg?style=flat-square | ||
@@ -20,0 +17,0 @@ [snyk-url]: https://snyk.io/test/npm/egg-logger |
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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
52555
1244
6