Add log_level cofiguration option

This commit is contained in:
Max Winterstein
2021-01-02 16:54:49 +01:00
parent 53dd8f9304
commit a1be30cd2b
2 changed files with 4 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
## [0.5.0] - 2021-01-02
- Improve image recration by adding some cache buster
- Change to bashio logs
- Add `log_level` cofiguration option
## [0.4.0] - 2021-01-02
- Change base image to `hassioaddons/debian-base`

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bashio
bashio::log.info "Exporting log level for nodejs: $(bashio::config log_level)"
export NODE_CONSOLE_LOG_LEVEL=`bashio::config log_level`
bashio::log.info "Symlinking data dir"
mkdir -p /share/eufy-ha-mqtt-bridge/data
rm -rf /app/data
@@ -10,8 +13,6 @@ echo '# Generated by homeassistant, do not edit!' > /app/data/config.yml
echo '# Edit configuration only at the Add-on configuration tab!' >> /app/data/config.yml
json2yml /data/options.json >> /app/data/config.yml
echo 'patching console log level'
sed -i "s/level: process.env.NODE_ENV === 'production' ? 'error' : 'debug'\,/level: 'info',/" /app/index.js
bashio::log.info "starting original stuff..."
npm run start