{"id":41134456,"url":"https://github.com/mirrorweb/sawmill","last_synced_at":"2026-01-22T18:36:06.834Z","repository":{"id":46158824,"uuid":"189990378","full_name":"mirrorweb/sawmill","owner":"mirrorweb","description":"A custom Python logger which can be configured to output logs to the user's preference.","archived":false,"fork":false,"pushed_at":"2024-07-12T14:07:48.000Z","size":137,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-07-13T15:15:28.971Z","etag":null,"topics":["devops-team"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirrorweb.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-03T11:13:58.000Z","updated_at":"2024-07-12T14:06:53.000Z","dependencies_parsed_at":"2022-09-23T06:23:03.278Z","dependency_job_id":"e5fe8934-166e-425c-b1d1-de701b36c731","html_url":"https://github.com/mirrorweb/sawmill","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mirrorweb/sawmill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirrorweb%2Fsawmill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirrorweb%2Fsawmill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirrorweb%2Fsawmill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirrorweb%2Fsawmill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirrorweb","download_url":"https://codeload.github.com/mirrorweb/sawmill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirrorweb%2Fsawmill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["devops-team"],"created_at":"2026-01-22T18:36:05.793Z","updated_at":"2026-01-22T18:36:06.814Z","avatar_url":"https://github.com/mirrorweb.png","language":"Python","readme":"# sawmill\nA custom Python logger which can be configured to output logs to the user's preference.\n\n### .env\nSawmill only has 1 environmental variable:\n\n| Name                | Required By         | Purpose             |\n|---------------------|---------------------|---------------------|\n| SAWMILL_DEVELOPER_LOGS | `sawmill.logger` | True/False - switches between outputting logs to terminal/local file store and outputting to sys.stdout |\n\n### usage\nInstead of doing the usual logger setup:\n```python\nimport logging\nimport sys\n\nlogger = logging.getLogger(__name__)\n\nconsole_handler = logging.StreamHandler()\nconsole_handler.setFormatter(logging.Formatter('%(levelname)s - %(message)s'))\nconsole_handler.setLevel(logging.DEBUG)\nlogger.addHandler(console_handler)\n\nstdout_handler = logging.StreamHandler(sys.stdout)\nstdout_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s %(filename)s'))\nstdout_handler.setLevel(logging.INFO)\nlogger.addHandler(stdout_handler)\n\nlogger.info('Logger has been created')\n```\n\nDo this instead:\n```python\nfrom sawmill.logger import Sawmill\n\nlogger = Sawmill.new_logger(__name__)\n\nlogger.info('Sawmill logger has been created')\n```\n\nAll the logging handlers \u0026 formatters are handled in the background removing the need to have the setup code\nat the top of your *.py files.\n\n\n# How To\n\nChange log format\n----\nLog format can be different per output type AND log level.\nGo into the sawmill/config.py file and select a 'MsgFormat' Enum option.\n\nDefine a new log format\n----\nGo into sawmill/utils.py and add to the existing 'MsgFormat' Enum.\n\nChange log colours\n----\nGo into the sawmill/config.py file and select an Enum option for primary, secondary \u0026 tertiary colours.\n\nDefine a new colour\n----\nColour Enum values are [256 colour codes].\nGo into sawmill/utils.py and add to the existing 'Colour' Enum.\n\nChange the log file location\n----\nGo into sawmill/config.py and update the dir / filename. The next time the app runs the new filename/folder will be used.\n\n### Terminal commands\n\n- `make env`\n    builds the project depedencies to a virtural environment using Poetry\n\n- `make run`\n    Doesn't do anything! Just here for consistency with our other projects\n\n- `$ make test`\n    Runs the test suite\n\n- `make lint`\n    formats code\n\n- `make docs`\n    uses Sphinx to auto-create documentation from doc-strings\n\n- `make requirements`\n    generates a up-to-date requirements.txt file\n\n\n[256 colour codes]: https://jonasjacek.github.io/colors/\n\nLicense\n----\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirrorweb%2Fsawmill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirrorweb%2Fsawmill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirrorweb%2Fsawmill/lists"}