Skip to content

Commit

Permalink
cleanup logging
Browse files Browse the repository at this point in the history
  • Loading branch information
howardt12345 committed Sep 17, 2024
1 parent a4d3b4b commit eed549b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
class Logging:
def __init__(self):
self.log_channel: discord.TextChannel = None
self.log_file_path = None
# self.log_file_path = None

def set_log_params(self, channel, log_file):
self.log_channel = channel
self.log_file_path = log_file
# self.log_file_path = log_file

async def log_to_channel(self, log_data: dict, color: discord.Color = None):
if not self.log_channel is None:
Expand All @@ -33,9 +33,10 @@ async def log_to_channel(self, log_data: dict, color: discord.Color = None):

def init(client: discord.Client, deployment_date: datetime):
log_channel = client.get_channel(int(os.getenv("LOG_CHANNEL")))
filename = f"{str(deployment_date).split('.')[0].replace(':', '-')}.log"
path = f"{sys.path[0]}/logs/{filename}"
logging.set_log_params(log_channel, path)
# filename = f"{str(deployment_date).split('.')[0].replace(':', '-')}.log"
# path = f"{sys.path[0]}/logs/{filename}"
# logging.set_log_params(log_channel, path)
logging.set_log_params(log_channel)


"""
Expand Down

0 comments on commit eed549b

Please sign in to comment.