Skip to content

Commit

Permalink
v2.4.4 remove logging file (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
brucewzj99 authored Dec 31, 2024
1 parent 4c14264 commit fa2ab75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bot/error_handler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import logging


logging.basicConfig(level=logging.ERROR, filename='telegram_bot.log',
format='%(asctime)s - %(levelname)s - %(message)s')
# logging.basicConfig(level=logging.ERROR, filename='telegram_bot.log',
# format='%(asctime)s - %(levelname)s - %(message)s')

class BaseError(Exception):
"""Base class for other exceptions"""
def __init__(self, error_class, message="An error occurred", extra_info=""):
self.message = message
self.extra_info = extra_info
self.error_class = error_class
logging.error(f"{error_class}: {message} {extra_info}")
# logging.error(f"{error_class}: {message} {extra_info}")
print(f"{error_class}: {message} {extra_info}")
super().__init__(f"{self.error_class}: {self.message}")

Expand Down

0 comments on commit fa2ab75

Please sign in to comment.