Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 7a2fbdb

Browse files
author
Michal Vlasák
committed
Update changelog and readme
1 parent 231ea13 commit 7a2fbdb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
## Changed
1616
- refactoring of express handlers
17+
- `severity` and `pkgVersion` fields hidden in pretty output
1718

1819
## [1.0.3] - 2018-11-08
1920

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ const logger = require('cosmas').default({
126126
```
127127

128128
## Environment-specific behavior
129-
`cosmas` is meant to be used throughout different environments (development, testing, production) and some of its configuration is setup differently based on the environment it runs in.
129+
`cosmas` is meant to be used throughout different environments (development, testing, production) and some of its configuration is setup differently based on the environment it runs in. By default, `severity` (contains current log level) and `pkgVersion` (contains current version of `cosmas`) fields are added to logged object.
130130

131131
### Testing
132132
If the `NODE_ENV` environment variable is set to `test`, all logs are turned off (minimal loglevel is set to `silent` which effectively turns logging off).
133133

134+
### Pretty print
135+
If you set `pretty` option to `true`, you enable pretty print mode intended for development use. `pkgVersion` and `severity` are ommited from output.
136+
134137
### Otherwise
135138
[Standard pino log](https://github.com/pinojs/pino#usage) is used and it's optimized for Google Stackdriver logging. That means that default log level is `debug`, pretty print is turned off and [pino's `messageKey` option](https://github.com/pinojs/pino/blob/master/docs/API.md#pinooptions-stream) is set to `message`.
136139

@@ -153,7 +156,7 @@ Options override both default logger configuration and environment-specific conf
153156
- `error` - logs `message`, `code`, `stack` and `data` fields
154157
- `processEnv` - logs `NODE_PATH` and `NODE_ENV`
155158
- `req` - logs `body`, `query`, `url`, `method` and omits `password` and `passwordCheck` from `body` and `query`
156-
- `res` - logs `out` and `time`
159+
- `res` - logs `out`, `time`, `headers.x-deviceid`, `headers.authorization` and `headers.user-agent`
157160

158161

159162
## Tips

0 commit comments

Comments
 (0)