Skip to content

Commit

Permalink
refactor: Adjust logging logic to match rest of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse committed Aug 11, 2024
1 parent 583288b commit 760a66d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions reaper/cogs/sentiment_analyzer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import logging
import coloredlogs

logger = logging.getLogger(__name__)
coloredlogs.install(
level="DEBUG", logger=logger, fmt="%(asctime)s - %(levelname)s - %(message)s"
)


from transformers import pipeline
from discord.ext import commands
import logging
import asyncio
import random
from util import globals
Expand Down Expand Up @@ -46,7 +54,7 @@ async def on_message(self, message):
self.sentiment, message.content
) # need to do this otherwise the bot will not do anything until this is done
except Exception as e:
logging.error(f"Error in sentiment analyzer: {e}")
logger.error(f"Error in sentiment analyzer: {e}")
return

self.bot.cached_sentiment[message.channel.id][result[0]["label"]] += 1
Expand Down

0 comments on commit 760a66d

Please sign in to comment.