Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-logger

Package Overview
Dependencies
Maintainers
11
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-logger - npm Package Compare versions

Comparing version 2.3.2 to 2.4.0

6

History.md
2.4.0 / 2019-03-14
==================
**features**
* [[`0cbbe47`](http://github.com/eggjs/egg-logger/commit/0cbbe47efb10897ac55a892bc670d3924a1ddfb5)] - feat: support contextFormatter (#51) (Haoliang Gao <<sakura9515@gmail.com>>)
2.3.2 / 2019-02-28

@@ -3,0 +9,0 @@ ==================

6

index.d.ts

@@ -22,3 +22,4 @@ interface ILoggerLevel {

file: string;
formatter?: any;
formatter?: (meta?: object) => string;
contextFormatter?: (meta?: object) => string;
jsonFile?: string;

@@ -164,3 +165,4 @@ outputJSON?: boolean;

level?: LoggerLevel;
formatter?: any;
formatter?: (meta?: object) => string;
contextFormatter?: (meta?: object) => string;
json?: boolean;

@@ -167,0 +169,0 @@ encoding?: string;

@@ -48,2 +48,6 @@ 'use strict';

};
Object.defineProperty(meta, 'ctx', {
enumerable: false,
value: this.ctx,
});
this._logger.log(LEVEL, arguments, meta);

@@ -50,0 +54,0 @@ };

@@ -46,2 +46,3 @@ 'use strict';

formatter: this.options.formatter,
contextFormatter: this.options.contextFormatter,
flushInterval: this.options.flushInterval,

@@ -67,2 +68,3 @@ eol: this.options.eol,

formatter: utils.consoleFormatter,
contextFormatter: this.options.contextFormatter,
eol: this.options.eol,

@@ -69,0 +71,0 @@ });

@@ -21,2 +21,3 @@ 'use strict';

* - {Function} formatter - format function
* - {Function} contextFormatter - format function for context logger
* - {Boolean} [json = false] - log format is json or not

@@ -39,2 +40,3 @@ * - {String} [encoding = utf8] - log encodeing, see {@link https://github.com/ashtuchkin/iconv-lite#supported-encodings}

formatter: null,
contextFormatter: null,
json: false,

@@ -41,0 +43,0 @@ encoding: 'utf8',

@@ -83,3 +83,4 @@ 'use strict';

let output;
const formatter = meta.formatter || options.formatter;
let formatter = meta.formatter || options.formatter;
if (meta.ctx && options.contextFormatter) formatter = options.contextFormatter;

@@ -86,0 +87,0 @@ if (args[0] instanceof Error) {

{
"name": "egg-logger",
"version": "2.3.2",
"version": "2.4.0",
"description": "egg logger",

@@ -57,4 +57,4 @@ "main": "index.js",

"index.js",
"index.d.ts",
"lib"
"lib",
"index.d.ts"
],

@@ -61,0 +61,0 @@ "ci": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc