Browse Source

logging fix

hvalev 3 years ago
parent
commit
6e5a3187e6
4 changed files with 5 additions and 5 deletions
  1. 1 1
      .github/workflows/main.yml
  2. 2 1
      Dockerfile
  3. 0 1
      README.md
  4. 2 2
      dht22mqtt.py

+ 1 - 1
.github/workflows/main.yml

@@ -8,7 +8,7 @@ on:
     - datasets/**
 
 env:
-  BUILD_VERSION: "0.1.0"
+  BUILD_VERSION: "0.1.1"
 
 jobs:
   test:

+ 2 - 1
Dockerfile

@@ -4,5 +4,6 @@ RUN apk add gcc musl-dev && \
     pip3 install -r requirements.txt --no-cache-dir && \
     pip3 cache purge && \
     apk del gcc musl-dev && \
-    rm -rf /var/lib/apk/lists/*
+    rm -rf /var/lib/apk/lists/* && \
+    mkdir log && chmod 777 log/
 CMD [ "python3", "-u", "dht22mqtt.py" ]

+ 0 - 1
README.md

@@ -40,7 +40,6 @@ The container offers the following configurable environment variables:</br>
 &emsp;&emsp;```essential``` - Enables basic MQTT communications. </br>
 &emsp;&emsp;```ha``` - Enables home assistant discovery. </br>
 &emsp;&emsp;```full``` - Enables sending information about the outlier detection algorithm internals over to the MQTT broker. </br>
-
 ```logging``` - Logging strategy. Possible values are ```log2stdout|log2file```. Default is ```None```. </br>
 &emsp;&emsp;```log2stdout``` - Forwards logs to stdout, inspectable through ```docker logs dht22mqtt```. </br>
 &emsp;&emsp;```log2file``` - Logs temperature and humidity readings to files timestamped at containers' start. </br>

+ 2 - 2
dht22mqtt.py

@@ -71,7 +71,7 @@ def log2stdout(timestamp, msg):
 
 
 ###############
-# Polling & Processing functions
+# Polling functions
 ###############
 def getTemperatureJitter(temperature):
     return getTemperature(temperature-0.3), getTemperature(temperature+0.3)
@@ -88,7 +88,7 @@ def getHumidity(humidity):
 
 
 ###############
-# Polling & Processing functions
+# Processing function
 ###############
 def processSensorValue(stack, error, value, value_type):
     # flush stack on accumulation of errors