change error logger to error
This commit is contained in:
parent
291675810c
commit
af36ddff75
|
@ -38,8 +38,8 @@ def read_users_points(db, user_id):
|
||||||
)
|
)
|
||||||
return cursor.fetchone()[0]
|
return cursor.fetchone()[0]
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured reading points:", e.args[0])
|
current_app.logger.error("Error occured reading points:", e.args[0])
|
||||||
current_app.logger.warning("To user:", user_id)
|
current_app.logger.error("To user:", user_id)
|
||||||
|
|
||||||
|
|
||||||
def read_all_users_with_username(db, username):
|
def read_all_users_with_username(db, username):
|
||||||
|
@ -51,8 +51,8 @@ def read_all_users_with_username(db, username):
|
||||||
users = cursor.fetchall()
|
users = cursor.fetchall()
|
||||||
return users
|
return users
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured reading points from username:", e.args[0])
|
current_app.logger.error("Error occured reading points from username:", e.args[0])
|
||||||
current_app.logger.warning("To user:", username)
|
current_app.logger.error("To user:", username)
|
||||||
|
|
||||||
|
|
||||||
def give_points_to_user(db, user_id, points):
|
def give_points_to_user(db, user_id, points):
|
||||||
|
@ -63,8 +63,8 @@ def give_points_to_user(db, user_id, points):
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured giving points:", e.args[0])
|
current_app.logger.error("Error occured giving points:", e.args[0])
|
||||||
current_app.logger.warning("To user:", user_id, " amount of points:", points)
|
current_app.logger.error("To user:", user_id, " amount of points:", points)
|
||||||
|
|
||||||
|
|
||||||
def use_points(db, user_id, points):
|
def use_points(db, user_id, points):
|
||||||
|
@ -76,8 +76,8 @@ def use_points(db, user_id, points):
|
||||||
db.commit()
|
db.commit()
|
||||||
return True
|
return True
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured using points:", e.args[0])
|
current_app.logger.error("Error occured using points:", e.args[0])
|
||||||
current_app.logger.warning("From user:", user_id, " amount of points:", points)
|
current_app.logger.error("From user:", user_id, " amount of points:", points)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ def user_exists(db, user_id):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured checking if user exists:", e.args[0])
|
current_app.logger.error("Error occured checking if user exists:", e.args[0])
|
||||||
current_app.logger.warning("To user:", user_id)
|
current_app.logger.error("To user:", user_id)
|
||||||
|
|
||||||
|
|
||||||
def add_user_to_database(db, user_id, display_name):
|
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()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured adding user to db:", e.args[0])
|
current_app.logger.error("Error occured adding user to db:", e.args[0])
|
||||||
current_app.logger.warning("To user:", user_id, display_name)
|
current_app.logger.error("To user:", user_id, display_name)
|
||||||
|
|
||||||
|
|
||||||
def change_display_name(db, user_id, new_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()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured changing display name:", e.args[0])
|
current_app.logger.error("Error occured changing display name:", e.args[0])
|
||||||
current_app.logger.warning("To user:", user_id, new_name)
|
current_app.logger.error("To user:", user_id, new_name)
|
||||||
|
|
||||||
|
|
||||||
def add_to_counter(db, counter_name):
|
def add_to_counter(db, counter_name):
|
||||||
|
@ -141,8 +141,8 @@ def add_to_counter(db, counter_name):
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured adding to counter:", e.args[0])
|
current_app.logger.error("Error occured adding to counter:", e.args[0])
|
||||||
current_app.logger.warning("To counter:", counter_name)
|
current_app.logger.error("To counter:", counter_name)
|
||||||
|
|
||||||
|
|
||||||
def add_to_redeem_queue(db, user_id, redeem_name, note=None):
|
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()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
current_app.logger.warning("Error occured adding to redeem queue:", e.args[0])
|
current_app.logger.error("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("To user:", user_id, " with redeem:", redeem_name, "with note:", note)
|
||||||
|
|
||||||
|
|
||||||
def all_counters(db):
|
def all_counters(db):
|
||||||
|
@ -164,7 +164,7 @@ def all_counters(db):
|
||||||
)
|
)
|
||||||
return cursor.fetchall()
|
return cursor.fetchall()
|
||||||
except Error as e:
|
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):
|
def pretty_redeem_queue(db):
|
||||||
|
@ -177,7 +177,7 @@ def pretty_redeem_queue(db):
|
||||||
)
|
)
|
||||||
return cursor.fetchall()
|
return cursor.fetchall()
|
||||||
except Error as e:
|
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):
|
def whole_redeem_queue(db):
|
||||||
|
@ -187,7 +187,7 @@ def whole_redeem_queue(db):
|
||||||
)
|
)
|
||||||
return cursor.fetchall()
|
return cursor.fetchall()
|
||||||
except Error as e:
|
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):
|
def remove_duplicate_usernames(db, user_id, username):
|
||||||
|
@ -200,4 +200,4 @@ def remove_duplicate_usernames(db, user_id, username):
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
except Error as e:
|
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])
|
||||||
|
|
Loading…
Reference in New Issue