Customizable timestamp

Add a customizable timestamp
This commit is contained in:
Kryzek
2019-11-17 19:33:46 +02:00
parent d2c4133e56
commit 7ae06e8e2c
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ const directory = settings.get().advanced.log_directory.replace('%TIMESTAMP%', t
fx.mkdirSync(directory);
// Determine the log level.
const level = settings.get().advanced.log_level;
const timestampFormat = () => moment().format(settings.get().advanced.timestamp_format);
const levelWithCompensatedLength = {
'info': 'info ',
+8
View File
@@ -99,6 +99,13 @@ const defaults = {
* Home Assistant status topic
*/
homeassistant_status_topic: 'hass/status',
/**
* Configurable timestampFormat
* https://github.com/Koenkk/zigbee2mqtt/commit/44db557a0c83f419d66755d14e460cd78bd6204e
*/
timestamp_format: 'YYYY-MM-DD HH:mm:ss',
},
};
@@ -152,6 +159,7 @@ const schema = {
report: {type: 'boolean'},
homeassistant_discovery_topic: {type: 'string'},
homeassistant_status_topic: {type: 'string'},
timestamp_format: {type: 'string'},
},
},
map_options: {