use the bot's logger
import asyncio
-import logging
import psutil
@@ -9,10 +8,6 @@ class ShitCordClient:
self.aiohttp = bot.aiohttp
self.statcord_token = statcord_key
- # setup logging
- self.logger = logging.getLogger("shitcord")
- self.logger.setLevel(logging.WARNING)
-
# setup counters
net_io_counter = psutil.net_io_counters()
self.prev_net_usage = net_io_counter.bytes_sent + net_io_counter.bytes_recv
@@ -48,12 +43,12 @@ class ShitCordClient:
try:
await self.post_stats()
except Exception as e:
- self.logger.error(f"SHITCORD ERROR: {e}")
+ self.bot.logger.error(f"SHITCORD ERROR: {e}")
await asyncio.sleep(60)
async def post_stats(self):
- self.logger.debug("posting data to shitcord...")
+ self.bot.logger.debug("posting data to shitcord...")
# get process details
p = psutil.Process()
@@ -98,6 +93,6 @@ class ShitCordClient:
)
if resp.status != 200:
- self.logger.error(f"SHITCORD ERROR: status was not 200 OK:\n{await resp.text()}")
+ self.bot.logger.error(f"SHITCORD ERROR: status was not 200 OK:\n{await resp.text()}")
else:
- self.logger.debug("successfully posted data to shitcord.")
+ self.bot.logger.debug("successfully posted data to shitcord.")
