diff --git a/app.py b/app.py index 3ad8e5c..86651fc 100644 --- a/app.py +++ b/app.py @@ -40,7 +40,7 @@ def index(): item4 = 0 item5 = 0 item6 = 0 - else: + elif wertfloat != -2: gesamtwert += wertfloat gesamtwert = round(gesamtwert, 2) if gesamtwert > 0: @@ -91,5 +91,13 @@ def favicon(): 'favicon.ico', mimetype='image/vnd.microsoft.icon') if __name__ == "__main__": + directory = './log' + if not os.path.exists(directory): + # Create the directory + os.makedirs(directory) + + logger = logging.getLogger(__name__) + logging.basicConfig(filename='./log/example.log', encoding='utf-8', level=logging.DEBUG) + logging.info('Starting erdbeerhannah v1.0') app.run(debug=True, host='0.0.0.0') \ No newline at end of file diff --git a/log/example.log b/log/example.log new file mode 100644 index 0000000..57785d6 --- /dev/null +++ b/log/example.log @@ -0,0 +1,16 @@ +INFO:root:Starting erdbeerhannah v1.0 +INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:5000 + * Running on http://192.168.177.24:5000 +INFO:werkzeug:Press CTRL+C to quit +INFO:werkzeug: * Restarting with stat +INFO:root:Starting erdbeerhannah v1.0 +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 213-823-308 +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:06] "POST / HTTP/1.1" 200 - +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:06] "GET /favicon.ico HTTP/1.1" 304 - +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:07] "POST / HTTP/1.1" 200 - +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:08] "POST / HTTP/1.1" 200 - +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:13] "POST / HTTP/1.1" 200 - +INFO:werkzeug:192.168.177.24 - - [26/May/2024 11:45:19] "POST / HTTP/1.1" 200 - diff --git a/templates/index.html b/templates/index.html index 2910733..4f270be 100644 --- a/templates/index.html +++ b/templates/index.html @@ -81,7 +81,7 @@
- +
🪙 {{ change }}€