From 0eb1a48fca5668c7c5c35ef81d247b4511d8e78a Mon Sep 17 00:00:00 2001 From: Samlon Date: Mon, 11 Aug 2025 17:16:33 +0200 Subject: changed printing to proper logging --- cogs/music/play.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cogs/music/play.py') diff --git a/cogs/music/play.py b/cogs/music/play.py index 5d82127..d902cdc 100644 --- a/cogs/music/play.py +++ b/cogs/music/play.py @@ -1,10 +1,13 @@ import asyncio +import logging import discord import yt_dlp from discord.ext import commands from youtubesearchpython import VideosSearch +logger = logging.getLogger(__name__) + # Suppress noise about console usage from yt-dlp yt_dlp.utils.bug_reports_message = lambda: '' @@ -45,13 +48,13 @@ class Play(commands.Cog): def after_playing(error): if error: - print(f'Player error: {error}') + logger.error(f'Player error: {error}') coro = vc.disconnect() fut = asyncio.run_coroutine_threadsafe(coro, self.bot.loop) try: fut.result() except Exception as e: - print(f'Error disconnecting: {e}') + logger.error(f'Error disconnecting: {e}', exc_info=True) source = discord.FFmpegPCMAudio(url2, **ffmpeg_options) vc.play(source, after=after_playing) -- cgit v1.2.3