mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-22 01:02:59 +01:00
🔨 Add logger level to config
This commit is contained in:
parent
57d0394dac
commit
bdfecede62
@ -24,15 +24,10 @@
|
||||
"hassio_role": "manager",
|
||||
"homeassistant_api": true,
|
||||
"options": {
|
||||
"ssl": false,
|
||||
"certfile": "fullchain.pem",
|
||||
"keyfile": "privkey.pem"
|
||||
"log_level": "info"
|
||||
},
|
||||
"schema": {
|
||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?",
|
||||
"ssl": "bool",
|
||||
"certfile": "str",
|
||||
"keyfile": "str",
|
||||
"leave_front_door_open": "bool?"
|
||||
},
|
||||
"ports": {
|
||||
|
@ -2,7 +2,7 @@ const appRoot = require("app-root-path");
|
||||
const winston = require("winston");
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: "debug",
|
||||
level: process.env.LOG_LEVEL || 'info' ,
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp({
|
||||
format: "YYYY-MM-DD HH:mm:ss",
|
||||
@ -11,6 +11,7 @@ const logger = winston.createLogger({
|
||||
// winston.format.splat(),
|
||||
|
||||
winston.format.colorize(),
|
||||
winston.format.align(),
|
||||
winston.format.printf(({ level, message, timestamp }) => {
|
||||
return `[${timestamp}] [${level}]: ${message}`;
|
||||
})
|
||||
|
@ -9,4 +9,9 @@
|
||||
# ==============================================================================
|
||||
|
||||
cd /opt/nextcloud_backup/
|
||||
npm start
|
||||
if bashio::config.exists 'log_level'; then
|
||||
LOG_LEVEL=$(bashio::config 'log_level')
|
||||
else
|
||||
LOG_LEVEL='info'
|
||||
fi
|
||||
LOG_LEVEL=$LOG_LEVEL npm start
|
Loading…
Reference in New Issue
Block a user