This file contains hidden or 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 json | |
| import logging | |
| from logging.config import dictConfig | |
| from package.module_x import lib_x | |
| from package.module_y import lib_y | |
| # configure logging in user program | |
| # lode json |
This file contains hidden or 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 json | |
| import logging | |
| import numpy as np | |
| from logging.config import dictConfig | |
| # configure logging module_y | |
| # lode json | |
| with open('package/logconfig.json', 'r') as file: | |
| conf = json.load(file) |
This file contains hidden or 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 json | |
| import logging | |
| import numpy as np | |
| from logging.config import dictConfig | |
| # configure logging in module_x | |
| # lode json | |
| with open('package/logconfig.json', 'r') as file: | |
| conf = json.load(file) |
This file contains hidden or 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
| { | |
| "version": 1, | |
| "disable_existing_loggers": false, | |
| "handlers": { | |
| "default": { | |
| "class": "logging.FileHandler", | |
| "filename": ".log", | |
| "level": "DEBUG" | |
| }, | |
| "stderror": { |
This file contains hidden or 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 | |
| from logging.config import dictConfig | |
| # configure logging in module_x | |
| # handlers | |
| handlers = {'default': {'class': 'logging.FileHandler', | |
| 'filename': '.log'}} | |
| # root |
This file contains hidden or 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
| # create file handler and config logging level | |
| handler = logging.FileHandler(filename='.log', mode='a', encoding='utf-8') | |
| handler.setLevel(logging.DEBUG) |
This file contains hidden or 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 | |
| from package.module_x import lib_x | |
| from package.module_y import lib_y | |
| # configure logging in user program | |
| # get the named logger object | |
| logger = logging.getLogger(__name__) | |
| # update logging level |
This file contains hidden or 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 | |
| # configure logging module_y | |
| # get the named logger object | |
| logger = logging.getLogger(__name__) | |
| # update logging level | |
| logger.setLevel(logging.DEBUG) |
This file contains hidden or 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 | |
| # configure logging in module_x | |
| # get the named logger object | |
| logger = logging.getLogger(__name__) | |
| # update logging level | |
| logger.setLevel(logging.DEBUG) |
This file contains hidden or 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 | |
| def do_something(): | |
| print("call this to do somthing") | |
| logging.debug("do somthing executed in module-lib.") |