change error logger to error

This commit is contained in:
Lili (Tlapka) 2022-11-25 15:11:42 +01:00
parent 291675810c
commit af36ddff75
1 changed files with 22 additions and 22 deletions

View File

@ -38,8 +38,8 @@ def read_users_points(db, user_id):
)
return cursor.fetchone()[0]
except Error as e:
current_app.logger.warning("Error occured reading points:", e.args[0])
current_app.logger.warning("To user:", user_id)
current_app.logger.error("Error occured reading points:", e.args[0])
current_app.logger.error("To user:", user_id)
def read_all_users_with_username(db, username):
@ -51,8 +51,8 @@ def read_all_users_with_username(db, username):
users = cursor.fetchall()
return users
except Error as e:
current_app.logger.warning("Error occured reading points from username:", e.args[0])
current_app.logger.warning("To user:", username)
current_app.logger.error("Error occured reading points from username:", e.args[0])
current_app.logger.error("To user:", username)
def give_points_to_user(db, user_id, points):
@ -63,8 +63,8 @@ def give_points_to_user(db, user_id, points):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured giving points:", e.args[0])
current_app.logger.warning("To user:", user_id, " amount of points:", points)
current_app.logger.error("Error occured giving points:", e.args[0])
current_app.logger.error("To user:", user_id, " amount of points:", points)
def use_points(db, user_id, points):
@ -76,8 +76,8 @@ def use_points(db, user_id, points):
db.commit()
return True
except Error as e:
current_app.logger.warning("Error occured using points:", e.args[0])
current_app.logger.warning("From user:", user_id, " amount of points:", points)
current_app.logger.error("Error occured using points:", e.args[0])
current_app.logger.error("From user:", user_id, " amount of points:", points)
return False
@ -91,8 +91,8 @@ def user_exists(db, user_id):
return False
return True
except Error as e:
current_app.logger.warning("Error occured checking if user exists:", e.args[0])
current_app.logger.warning("To user:", user_id)
current_app.logger.error("Error occured checking if user exists:", e.args[0])
current_app.logger.error("To user:", user_id)
def add_user_to_database(db, user_id, display_name):
@ -117,8 +117,8 @@ def add_user_to_database(db, user_id, display_name):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured adding user to db:", e.args[0])
current_app.logger.warning("To user:", user_id, display_name)
current_app.logger.error("Error occured adding user to db:", e.args[0])
current_app.logger.error("To user:", user_id, display_name)
def change_display_name(db, user_id, new_name):
@ -129,8 +129,8 @@ def change_display_name(db, user_id, new_name):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured changing display name:", e.args[0])
current_app.logger.warning("To user:", user_id, new_name)
current_app.logger.error("Error occured changing display name:", e.args[0])
current_app.logger.error("To user:", user_id, new_name)
def add_to_counter(db, counter_name):
@ -141,8 +141,8 @@ def add_to_counter(db, counter_name):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured adding to counter:", e.args[0])
current_app.logger.warning("To counter:", counter_name)
current_app.logger.error("Error occured adding to counter:", e.args[0])
current_app.logger.error("To counter:", counter_name)
def add_to_redeem_queue(db, user_id, redeem_name, note=None):
@ -153,8 +153,8 @@ def add_to_redeem_queue(db, user_id, redeem_name, note=None):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured adding to redeem queue:", e.args[0])
current_app.logger.warning("To user:", user_id, " with redeem:", redeem_name, "with note:", note)
current_app.logger.error("Error occured adding to redeem queue:", e.args[0])
current_app.logger.error("To user:", user_id, " with redeem:", redeem_name, "with note:", note)
def all_counters(db):
@ -164,7 +164,7 @@ def all_counters(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.warning("Error occured selecting all counters:", e.args[0])
current_app.logger.error("Error occured selecting all counters:", e.args[0])
def pretty_redeem_queue(db):
@ -177,7 +177,7 @@ def pretty_redeem_queue(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.warning("Error occured selecting pretty redeem queue:", e.args[0])
current_app.logger.error("Error occured selecting pretty redeem queue:", e.args[0])
def whole_redeem_queue(db):
@ -187,7 +187,7 @@ def whole_redeem_queue(db):
)
return cursor.fetchall()
except Error as e:
current_app.logger.warning("Error occured selecting redeem queue:", e.args[0])
current_app.logger.error("Error occured selecting redeem queue:", e.args[0])
def remove_duplicate_usernames(db, user_id, username):
@ -200,4 +200,4 @@ def remove_duplicate_usernames(db, user_id, username):
)
db.commit()
except Error as e:
current_app.logger.warning("Error occured removing duplicate usernames:", e.args[0])
current_app.logger.error("Error occured removing duplicate usernames:", e.args[0])