From 0a8a6a2817d7da7dc5ea44767139f171be341309 Mon Sep 17 00:00:00 2001 From: Lonami Date: Mon, 25 Jun 2018 09:26:08 +0200 Subject: [PATCH] Destroyed Enabling logging (markdown) --- Enabling-logging.md | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 Enabling-logging.md diff --git a/Enabling-logging.md b/Enabling-logging.md deleted file mode 100644 index 0ffdb1e..0000000 --- a/Enabling-logging.md +++ /dev/null @@ -1,27 +0,0 @@ -Telethon makes use of the [`logging`](https://docs.python.org/3/library/logging.html) module, and you can enable it as follows: - -```python -import logging -logging.basicConfig(level=logging.DEBUG) -``` - -The library has the [`NullHandler`](https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library) added by default so that no log calls will be printed unless you explicitly enable it. - -You can also [use the module](https://docs.python.org/3/howto/logging.html) on your own project very easily: - -```python -import logging -logger = logging.getLogger(__name__) - -logger.debug('Debug messages') -logger.info('Useful information') -logger.warning('This is a warning!') -``` - -If you want to enable `logging` for your project *but* use a different log level for the library: -```python -import logging -logging.basicConfig(level=logging.DEBUG) -# For instance, show only warnings and above -logging.getLogger('telethon').setLevel(level=logging.WARNING) -``` \ No newline at end of file