From 25b1fe21b9a13376e43fb92469f92544beaaab7f Mon Sep 17 00:00:00 2001 From: zizifn <515868058@qq.com> Date: Wed, 25 May 2022 23:22:03 +0800 Subject: [PATCH 1/5] update documentation for #2114 --- README.md | 2 +- UPGRADE-3.0.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5acb85730..ee6bf3ca7 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ if (process.env.NODE_ENV !== 'production') { You may also log directly via the default logger exposed by `require('winston')`, but this merely intended to be a convenient shared -logger to use throughout your application if you so choose. +logger to use throughout your application if you so choose. And default logger don't have any transports by default, your need add transports by yourself, otherwise you may encounter memory issue. ## Table of contents diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 02901636c..528313b1d 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -24,6 +24,7 @@ - `winston.Logger` has been replaced with `winston.createLogger`. - `winston.setLevels` has been removed. Levels are frozen at the time of Logger creation. - Setting the level on the default `winston` logger no longer sets the level on the transports associated with the default `winston` logger. +- Default logger exposed by `require('winston')` no longer have default `Console` transports. ### Transports - `winston.transports.Memory` was removed. Use any Node.js `stream.Writeable` with a large `highWaterMark` instance instead. @@ -39,7 +40,7 @@ - `debugStdout` option has been removed. ### `winston.Container` and `winston.loggers` -- `winston.Container` instances no longer have default `Console` transports +- `winston.Container` instances no longer have default `Console` transports. - `winston.Container.prototype.add` no longer does crazy options parsing. Implementation inspired by [segmentio/winston-logger](https://github.com/segmentio/winston-logger/blob/master/lib/index.js#L20-L43) ### `winston.Logger` From 539b36065f23cfdc4cd251ea32d590a44b77878d Mon Sep 17 00:00:00 2001 From: zizifn <515868058@qq.com> Date: Wed, 25 May 2022 23:29:31 +0800 Subject: [PATCH 2/5] fix typo update documentation for #2114 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee6bf3ca7..a09c9d2fa 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ if (process.env.NODE_ENV !== 'production') { You may also log directly via the default logger exposed by `require('winston')`, but this merely intended to be a convenient shared -logger to use throughout your application if you so choose. And default logger don't have any transports by default, your need add transports by yourself, otherwise you may encounter memory issue. +logger to use throughout your application if you so choose. And default logger don't have any transports by default, you need add transports by yourself, otherwise you may encounter memory issue. ## Table of contents From 10ff794a6ae6b027541f07d68c9129957c78c28a Mon Sep 17 00:00:00 2001 From: wbt Date: Wed, 25 May 2022 16:29:56 -0400 Subject: [PATCH 3/5] Fix up grammar, add line breaks --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a09c9d2fa..f646e81c8 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,10 @@ if (process.env.NODE_ENV !== 'production') { You may also log directly via the default logger exposed by `require('winston')`, but this merely intended to be a convenient shared -logger to use throughout your application if you so choose. And default logger don't have any transports by default, you need add transports by yourself, otherwise you may encounter memory issue. +logger to use throughout your application if you so choose. +Note that the default logger doesn't have any transports by default. +You need add transports by yourself, and leaving the default logger without any +transports may produce a high memory usage issue. ## Table of contents From 11e5cde8cfea354f7a78162c5c15e2fd3a1ca138 Mon Sep 17 00:00:00 2001 From: wbt Date: Wed, 25 May 2022 16:31:03 -0400 Subject: [PATCH 4/5] Trim a trailing whitespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f646e81c8..8f9beafe5 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ if (process.env.NODE_ENV !== 'production') { You may also log directly via the default logger exposed by `require('winston')`, but this merely intended to be a convenient shared -logger to use throughout your application if you so choose. +logger to use throughout your application if you so choose. Note that the default logger doesn't have any transports by default. You need add transports by yourself, and leaving the default logger without any transports may produce a high memory usage issue. From cfb79cfff270e67597c62a03f44774367c5ce2fc Mon Sep 17 00:00:00 2001 From: wbt Date: Wed, 25 May 2022 16:34:21 -0400 Subject: [PATCH 5/5] Fix grammar & add consequences --- UPGRADE-3.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 528313b1d..1f2951e33 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -24,7 +24,8 @@ - `winston.Logger` has been replaced with `winston.createLogger`. - `winston.setLevels` has been removed. Levels are frozen at the time of Logger creation. - Setting the level on the default `winston` logger no longer sets the level on the transports associated with the default `winston` logger. -- Default logger exposed by `require('winston')` no longer have default `Console` transports. +- The default logger exposed by `require('winston')` no longer has default `Console` transports, +and leaving it without transports may cause a high memory usage issue. ### Transports - `winston.transports.Memory` was removed. Use any Node.js `stream.Writeable` with a large `highWaterMark` instance instead. @@ -41,6 +42,7 @@ ### `winston.Container` and `winston.loggers` - `winston.Container` instances no longer have default `Console` transports. +Failing to add any transports may cause a high memory usage issue. - `winston.Container.prototype.add` no longer does crazy options parsing. Implementation inspired by [segmentio/winston-logger](https://github.com/segmentio/winston-logger/blob/master/lib/index.js#L20-L43) ### `winston.Logger`