{"id":18247057,"url":"https://github.com/badbye/timelog","last_synced_at":"2025-04-08T19:35:26.859Z","repository":{"id":66176055,"uuid":"100392939","full_name":"badbye/timelog","owner":"badbye","description":"Split python logger by time for multiple processings.","archived":false,"fork":false,"pushed_at":"2017-10-18T09:41:33.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T07:48:08.329Z","etag":null,"topics":["log","python"],"latest_commit_sha":null,"homepage":null,"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/badbye.png","metadata":{"files":{"readme":"README.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-15T15:42:07.000Z","updated_at":"2017-10-18T09:33:15.000Z","dependencies_parsed_at":"2023-02-21T16:45:23.915Z","dependency_job_id":null,"html_url":"https://github.com/badbye/timelog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Ftimelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Ftimelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Ftimelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Ftimelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badbye","download_url":"https://codeload.github.com/badbye/timelog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912999,"owners_count":21017078,"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":["log","python"],"created_at":"2024-11-05T09:28:50.846Z","updated_at":"2025-04-08T19:35:26.839Z","avatar_url":"https://github.com/badbye.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"cotimelog\r\n=========\r\n\r\n|image0| |PyPI|\r\n\r\n\r\n**cotimelog**, inspired from [ConcurrentLogHandler](https://pypi.python.org/pypi/ConcurrentLogHandler/0.9.1).\r\nTo be honest, it is almost the same code. Just edit to make the log file rotated by time.\r\n\r\n\r\nInstallation\r\n============\r\n\r\n    pip install cotimelog\r\n\r\n\r\nConcurrentTimeRotatingFileHandler\r\n---------------------------------\r\n\r\nThis class is a log handler which is a drop-in replacement for the python standard log handler\r\n``TimedRotatingFileHandler``.\r\nThe TimedRotatingFileHandler will failed to rotate when multiple processes are trying to\r\nwrite into the same file. You will meet this issue when you use uwsgi.\r\nThis ``ConcurrentTimeRotatingFileHandler`` class is mainly developed to fix this issue.\r\n\r\nUsage\r\n`````\r\n\r\nUsing ``ConcurrentTimeRotatingFileHandler`` ::\r\n\r\n    import os\r\n    import time\r\n    from logging import getLogger, INFO\r\n    from cotimelog import ConcurrentTimeRotatingFileHandler\r\n\r\n    # Use an absolute path to prevent file rotation trouble.\r\n    log = getLogger()\r\n    logfile = os.path.abspath(\"mylogfile.log\")\r\n    # Rotate log after 1 second\r\n    rotateHandler = ConcurrentTimeRotatingFileHandler(logfile, mode=\"a\", when=\"S\", backupCount=5)\r\n    log.addHandler(rotateHandler)\r\n    log.setLevel(INFO)\r\n\r\n    [log.info(str(i)) for i in range(10)]\r\n    time.sleep(1)\r\n    [log.info(str(i)) for i in range(10, 100)]\r\n\r\n\r\n\r\n\r\nLicense\r\n^^^^^^^\r\n\r\n`Apache License, Version 2.0 \u003chttp://www.apache.org/licenses/LICENSE-2.0.html\u003e`_\r\n\r\n\r\n.. |image0| image:: https://travis-ci.org/badbye/timelog.svg?branch=master\r\n.. |PyPI| image:: https://img.shields.io/pypi/pyversions/cotimelog.svg?style=flat-square\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbye%2Ftimelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadbye%2Ftimelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbye%2Ftimelog/lists"}