Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Logging Interference: Custom Logger Stops Functioning After Using TikTokPy Methods #345

Open
Aagnen opened this issue Nov 17, 2024 · 0 comments

Comments

@Aagnen
Copy link

Aagnen commented Nov 17, 2024

I'm experiencing an issue where, after invoking TikTokPy methods within my project, my custom logger ceases to function correctly. Specifically, log messages stop appearing or become duplicated, and the intended formatting (including colors and emojis) is lost. It appears that TikTokPy modifies the global logging configuration, which interferes with my application's logging setup.

Environment:

Python Version: 3.9
TikTokPy Version: 0.9.4
Operating System: Windows 10
Logging Libraries: logging, colorlog
Other Dependencies:
notion-client
requests

Additional Information:

Logger Configuration: The custom logger is configured to prevent propagation to the root logger (logger.propagate = False).
TikTokPy Logging: TikTokPy's internal logs are displayed using a different format and do not interfere before calling its methods. However, post invocation, the custom logger's functionality is compromised.

Possible Solution

  • Isolate TikTokPy's Logger: Ensure that TikTokPy uses its own logger instance without modifying the global or root logger's configuration.
  • Avoid Global Logging Modifications: TikTokPy should not alter the root logger or remove existing handlers, allowing custom loggers to function independently.
  • Provide Configuration Options: Allow users to disable TikTokPy's internal logging or set it to a specific log level without affecting other loggers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant