From 91ec06961d2cc9a522f65c023cd02871aa6d97b2 Mon Sep 17 00:00:00 2001 From: Alejandro Campos Date: Sat, 16 Sep 2023 20:21:05 -0300 Subject: [PATCH] chore(README.md): adds documentation around coloring json formatted logs --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a36b8a0cc..585c46f99 100644 --- a/README.md +++ b/README.md @@ -675,10 +675,21 @@ To colorize the standard logging level add ```js winston.format.combine( winston.format.colorize(), - winston.format.json() + winston.format.simple() +); +``` +where `winston.format.simple()` is whatever other formatter you want to use. The `colorize` formatter must come before any formatters adding text you wish to color. + +### Colorizing full log line when json formatting logs + +To colorize the full log line with the json formatter you can apply the following + +```js +winston.format.combine( + winston.format.json(), + winston.format.colorize({ all }) ); ``` -where `winston.format.json()` is whatever other formatter you want to use. The `colorize` formatter must come before any formatters adding text you wish to color. ## Transports