mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-22 18:49:59 +00:00
Customizable timestamp
Add a customizable timestamp
This commit is contained in:
+1
-1
@@ -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 ',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user