From 2c546151e10b22ec25b559d17cffc35882d094d2 Mon Sep 17 00:00:00 2001 From: Arjan van Bentem Date: Mon, 14 May 2018 21:51:54 +0200 Subject: [PATCH] docs: date format for file names has changed --- CHANGELOG.md | 5 +++-- config-example-ttn.js | 7 ++++--- watchdog.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 709793d..9c74d33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/config-example-ttn.js b/config-example-ttn.js index 34cda6f..e140f77 100644 --- a/config-example-ttn.js +++ b/config-example-ttn.js @@ -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 }, @@ -51,7 +52,7 @@ module.exports = { info: { level: 'info', filename: 'uart-monitor-info-%DATE%.log', - datePattern: 'yyyyMMdd', + datePattern: 'YYYYMMDD', formatter: options => `[${ (new Date()).toISOString() }] [${ options.level }] ${ options.message }` }, @@ -59,7 +60,7 @@ module.exports = { warn: { level: 'warn', filename: 'uart-monitor-warn-%DATE%.log', - datePattern: 'yyyyMMdd' + datePattern: 'YYYYMMDD' }, }, diff --git a/watchdog.js b/watchdog.js index 77b6ab1..0c17703 100644 --- a/watchdog.js +++ b/watchdog.js @@ -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) {