Skip to content

Commit

Permalink
docs: date format for file names has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
avbentem committed May 14, 2018
1 parent 96a49d1 commit 2c54615
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

### Breaking changes

- The filename suffix has moved from `datePattern` to `filename` and the latter supports the `%DATE%` token, like
`datePattern: 'yyyyMMdd'` and `filename: 'uart-monitor-all-%DATE%.log'`.
- The filename suffix has moved from `datePattern` into `filename`. The latter now supports the `%DATE%` token, where
the first now uses the [moment.js date format](http://momentjs.com/docs/#/displaying/format/), like
`datePattern: 'YYYYMMDD'` (instead of `'yyyyMMdd.log'`) and `filename: 'uart-monitor-all-%DATE%.log'`.

- The configuration for the watchdogs is now an array, and has been renamed to `watchdogs`; see
[`config-example-ttn.js`](./config-example-ttn.js).
Expand Down
7 changes: 4 additions & 3 deletions config-example-ttn.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ module.exports = {
level: 'debug',
// The directory defaults to the current folder, and can be specified in either `filename` or in `dirname`
filename: 'uart-monitor-all-%DATE%.log',
datePattern: 'yyyyMMdd'
// See http://momentjs.com/docs/#/displaying/format/
datePattern: 'YYYYMMDD'
// Archives are compressed by default
// zippedArchive: false
},
Expand All @@ -51,15 +52,15 @@ module.exports = {
info: {
level: 'info',
filename: 'uart-monitor-info-%DATE%.log',
datePattern: 'yyyyMMdd',
datePattern: 'YYYYMMDD',
formatter: options => `[${ (new Date()).toISOString() }] [${ options.level }] ${ options.message }`
},

// Optional file to which only error messages of levels WARN and above are saved.
warn: {
level: 'warn',
filename: 'uart-monitor-warn-%DATE%.log',
datePattern: 'yyyyMMdd'
datePattern: 'YYYYMMDD'
},

},
Expand Down
2 changes: 1 addition & 1 deletion watchdog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Watchdog {
/**
* Registers a plain heartbeat, if no patterns have been configured to match specific messages.
*
* If patterns have been configured then this is ignored and {@link Watchdog.message} is handled instead.
* If patterns have been configured then this is ignored and {@link Watchdog#message} is handled instead.
*/
heartbeat() {
if (!this.config.include) {
Expand Down

0 comments on commit 2c54615

Please sign in to comment.