Last active
June 7, 2019 12:33
-
-
Save pelid/01476edf965f8be239b72397f658d13b to your computer and use it in GitHub Desktop.
Пример использования модуля logging.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test_b | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
test_b.log_something() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Вывод на экран такой | |
``` | |
$ python main.py | |
INFO:B:log_something | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger('B') | |
def log_something(): | |
logger.info('log_something') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment