{"id":43034959,"url":"https://github.com/aatifsyed/logging-actions","last_synced_at":"2026-01-31T08:14:50.070Z","repository":{"id":62576686,"uuid":"382163833","full_name":"aatifsyed/logging-actions","owner":"aatifsyed","description":"For easy command-line configuration of loggers","archived":false,"fork":false,"pushed_at":"2022-03-10T17:06:22.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T07:34:40.510Z","etag":null,"topics":["argparse","logger","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aatifsyed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-01T21:48:28.000Z","updated_at":"2021-12-27T05:50:53.000Z","dependencies_parsed_at":"2022-11-03T20:43:49.925Z","dependency_job_id":null,"html_url":"https://github.com/aatifsyed/logging-actions","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/aatifsyed/logging-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatifsyed%2Flogging-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatifsyed%2Flogging-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatifsyed%2Flogging-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatifsyed%2Flogging-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aatifsyed","download_url":"https://codeload.github.com/aatifsyed/logging-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatifsyed%2Flogging-actions/sbom","scorecard":{"id":159613,"data":{"date":"2025-08-11","repo":{"name":"github.com/aatifsyed/logging-actions","commit":"648c6b553f614d93071c197ac33502de9623c7dc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T12:58:05.545Z","repository_id":62576686,"created_at":"2025-08-16T12:58:05.545Z","updated_at":"2025-08-16T12:58:05.545Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28934832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T07:49:44.436Z","status":"ssl_error","status_checked_at":"2026-01-31T07:49:34.274Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["argparse","logger","logging","python"],"created_at":"2026-01-31T08:14:49.980Z","updated_at":"2026-01-31T08:14:50.061Z","avatar_url":"https://github.com/aatifsyed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![pypi](https://img.shields.io/pypi/v/logging-actions)](https://pypi.org/project/logging-actions/)\n[![github](https://img.shields.io/static/v1?label=\u0026message=github\u0026color=grey\u0026logo=github)](https://github.com/aatifsyed/logging-actions)\n\n\u003c/div\u003e\n\n# `logging-actions`\nFor easy configuration of `logging.Logger`s with `argparse.Action`s.\n\nUse it like this:\n```python\n\u003e\u003e\u003e from logging_actions import log_level_action\n\u003e\u003e\u003e from argparse import ArgumentParser\n\u003e\u003e\u003e import logging\n\n\u003e\u003e\u003e logger = logging.getLogger(\"foo\") # Create your script's logger\n\u003e\u003e\u003e logger.addHandler(logging.StreamHandler())  # Don't forget to add a handler!\n\n\u003e\u003e\u003e parser = ArgumentParser()\n\u003e\u003e\u003e _ = parser.add_argument(\"--log-level\", action=log_level_action(logger)) # create an action for your module's logger\n\u003e\u003e\u003e args = parser.parse_args() # Your logger's level will be set for you when parsing\n\n```\n\n## Features\n### Choices are handled transparently\n```text\nfoo.py --help\n\nusage: foo.py [-h] [--log-level {critical,fatal,error,warn,warning,info,debug,notset}]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --log-level {critical,fatal,error,warn,warning,info,debug,notset}\n                        Set the logging level for foo.\n```\n\n### If you specify a default the log-level will be set accordingly\n```python\nparser.add_argument(\"-l\", \"--log-level\", action=log_level_action(logger), default=\"info\")\n```\n\n### Custom levels are supported\n```python\nlogging.addLevelName(5, \"TRACE\")\nparser.add_argument(\"-l\", action=log_level_action(logger), default=\"trace\")\n```\n\n## Benefits\n### A better logging pattern\nThis replaces the following pattern for setting script log levels\n```python\nfrom argparse import ArgumentParser\n\nparser = ArgumentParser()\nparser.add_argument(\n    \"--log-level\",\n    default=logging.INFO,\n    type=lambda x: getattr(logging, x)),\n    help=\"Configure the logging level.\",\n)\nargs = parser.parse_args()\nlogging.basicConfig(level=args.log_level)\n```\n### Manage multiple loggers easily\n```python\nparser.add_argment(\"--foo-log-level\", action=log_level_action(foo_logger))\nparser.add_argment(\"--bar-log-level\", action=log_level_action(bar_logger))\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatifsyed%2Flogging-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faatifsyed%2Flogging-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatifsyed%2Flogging-actions/lists"}