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