{"id":18684862,"url":"https://github.com/j-sephb-lt-n/multi-script-python-logging","last_synced_at":"2025-11-07T21:30:36.892Z","repository":{"id":215632756,"uuid":"739418038","full_name":"J-sephB-lt-n/multi-script-python-logging","owner":"J-sephB-lt-n","description":"A simple example showing how python modules share logging config","archived":false,"fork":false,"pushed_at":"2024-01-05T14:36:03.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T00:21:26.627Z","etag":null,"topics":["logging","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/J-sephB-lt-n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-05T14:16:38.000Z","updated_at":"2024-01-05T14:37:48.000Z","dependencies_parsed_at":"2024-01-05T15:55:06.179Z","dependency_job_id":null,"html_url":"https://github.com/J-sephB-lt-n/multi-script-python-logging","commit_stats":null,"previous_names":["j-sephb-lt-n/multi-script-python-logging"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fmulti-script-python-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fmulti-script-python-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fmulti-script-python-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fmulti-script-python-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J-sephB-lt-n","download_url":"https://codeload.github.com/J-sephB-lt-n/multi-script-python-logging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239539821,"owners_count":19655886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","python"],"created_at":"2024-11-07T10:19:33.486Z","updated_at":"2025-02-18T19:44:39.589Z","avatar_url":"https://github.com/J-sephB-lt-n.png","language":"Python","readme":"# multi-script-python-logging\n\nThis repo contains a simple example illustrating how imported modules (module1.py and module.py) inherit their logging format from the script which imported them (main.py).\n\n```python\n# module1.py # \nimport logging\nlogger = logging.getLogger(__name__)\ndef explain():\n    logger.info(\"this is a log message from module1.py\")\n\n# module2.py #\nimport logging                                                                                                                                           \nlogger = logging.getLogger(__name__)\ndef explain():\n    logger.info(\"this is a log message from module2.py\")\n\n# main.py #\nimport logging\nimport module1\nimport module2\n\nlogging.basicConfig(level=logging.INFO, format=\"%(asctime)s - %(name)s - %(levelname)s - %(message)s\")\nlogger = logging.getLogger(__name__)\n\nif __name__==\"__main__\":\n    logger.info(\"this is a log message from main.py\")\n    module1.explain()\n    module2.explain()\n```\n\n```bash\n~$ python main.py\n2024-01-05 16:32:09,132 - __main__ - INFO - this is a log message from main.py\n2024-01-05 16:32:09,132 - module1 - INFO - this is a log message from module1.py\n2024-01-05 16:32:09,132 - module2 - INFO - this is a log message from module2.py\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fmulti-script-python-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-sephb-lt-n%2Fmulti-script-python-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fmulti-script-python-logging/lists"}