[GH-ISSUE #661] How to disable printing/logging errors #394

Closed
opened 2026-02-27 23:22:23 +03:00 by kerem · 2 comments
Owner

Originally created by @francisgianj on GitHub (Mar 27, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/661

Hi, I'd like to disable the error being printed when there's any error.
e.g.
HTTP Error for PUT to https://api.spotify.com/v1/me/player/play returned 403 due to Player command failed: Restriction violated

I'm not printing any error with my try/except blocks but the example above keeps printing even though I don't wanna. Please help. Thank you in advance :)

Originally created by @francisgianj on GitHub (Mar 27, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/661 <!--- Please make sure you've: - read the FAQ https://github.com/plamere/spotipy/blob/master/FAQ.md - read the documentation https://spotipy.readthedocs.io/en/latest/ - searched older issues If your question is about code, please share the code you are using ---> Hi, I'd like to disable the error being printed when there's any error. e.g. `HTTP Error for PUT to https://api.spotify.com/v1/me/player/play returned 403 due to Player command failed: Restriction violated` I'm not printing any error with my try/except blocks but the example above keeps printing even though I don't wanna. Please help. Thank you in advance :)
kerem 2026-02-27 23:22:23 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Peter-Schorn commented on GitHub (Mar 27, 2021):

Here's how to suppress log messages:

import logging

logging.disable(logging.CRITICAL)
<!-- gh-comment-id:808810452 --> @Peter-Schorn commented on GitHub (Mar 27, 2021): Here's how to suppress log messages: ```python import logging logging.disable(logging.CRITICAL) ```
Author
Owner

@francisgianj commented on GitHub (Mar 28, 2021):

Thanks Peter! it's not logging anymore.

<!-- gh-comment-id:808839638 --> @francisgianj commented on GitHub (Mar 28, 2021): Thanks Peter! it's not logging anymore.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#394
No description provided.