]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Improve log messages
authorMichal Sojka <michal.sojka@cvut.cz>
Thu, 16 Aug 2018 13:41:09 +0000 (15:41 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 16 Aug 2018 13:41:09 +0000 (15:41 +0200)
app.py
coffee_db.py

diff --git a/app.py b/app.py
index 231e03afc043a6d33076a104656db7c76e78129b..54816242b4640af21592d5c153f659a4ccadd3f1 100644 (file)
--- a/app.py
+++ b/app.py
@@ -145,6 +145,7 @@ def coffee_graph_history():
 def coffee_add():
     if request.method == "POST":
         json = request.json
+        print("User '%(uid)s' had '%(flavor)s' at %(time)s" % json)
         db.add_coffee(json["uid"], json["flavor"], json["time"])
     return redirect(url_for('user'))
 
@@ -167,6 +168,6 @@ def js():
 def log():
     if request.method == "POST":
         data = request.data.decode("utf-8")
-        print(data)
+        print("Log:", data)
         return data
     return "nope"
index a838746dfaf9ba9e77f1ff5fc6f8634c9dab375a..0abb5a4fe68a0010ea5cb7d12ad97cc3062bf434 100644 (file)
@@ -48,7 +48,6 @@ def list_users():
 
 def add_coffee(uid, flavor, time=None):
     conn, c = open_db()
-    print(uid, flavor, time)
     if time is None:
         c.execute("insert into coffees (id, flavor) values (?,?)", (uid,flavor))
     else: