mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-04 22:42:21 +00:00
Change stderr prints to use the logging module instead
This commit is contained in:
@@ -29,7 +29,6 @@ import datetime
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
import traceback
|
||||
from typing import (
|
||||
Any,
|
||||
AsyncIterator,
|
||||
@@ -519,16 +518,16 @@ class Client:
|
||||
|
||||
The default error handler provided by the client.
|
||||
|
||||
By default this prints to :data:`sys.stderr` however it could be
|
||||
By default this logs to the library logger however it could be
|
||||
overridden to have a different implementation.
|
||||
Check :func:`~discord.on_error` for more details.
|
||||
|
||||
.. versionchanged:: 2.0
|
||||
|
||||
``event_method`` parameter is now positional-only.
|
||||
``event_method`` parameter is now positional-only
|
||||
and instead of writing to ``sys.stderr`` it logs instead.
|
||||
"""
|
||||
print(f'Ignoring exception in {event_method}', file=sys.stderr)
|
||||
traceback.print_exc()
|
||||
_log.exception('Ignoring exception in %s', event_method)
|
||||
|
||||
# hooks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user