Skip to content

Commit

Permalink
chore(README.md): adds documentation around coloring json formatted logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroFabianCampos authored and wbt committed Nov 8, 2023
1 parent c3c3911 commit 91ec069
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 91ec069

Please sign in to comment.