{"id":19860373,"url":"https://github.com/mwksolution/mwk-logger","last_synced_at":"2026-06-10T19:31:53.023Z","repository":{"id":59598047,"uuid":"499564167","full_name":"MWKSolution/mwk-logger","owner":"MWKSolution","description":"Custom logger with colors on terminal and some useful decorators.","archived":false,"fork":false,"pushed_at":"2024-01-27T18:28:16.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T14:47:25.402Z","etag":null,"topics":["colored","logger"],"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/MWKSolution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-06-03T15:38:41.000Z","updated_at":"2022-09-18T11:50:30.000Z","dependencies_parsed_at":"2025-01-11T14:44:03.292Z","dependency_job_id":"521b6649-b037-4a75-944f-b5cfbdf49af1","html_url":"https://github.com/MWKSolution/mwk-logger","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"cfbc45f749d77620d02665a1b37a2b79e5b2352d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MWKSolution%2Fmwk-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MWKSolution%2Fmwk-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MWKSolution%2Fmwk-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MWKSolution%2Fmwk-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MWKSolution","download_url":"https://codeload.github.com/MWKSolution/mwk-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241262620,"owners_count":19936047,"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":["colored","logger"],"created_at":"2024-11-12T15:05:31.419Z","updated_at":"2026-06-10T19:31:52.993Z","avatar_url":"https://github.com/MWKSolution.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# MWK logger\n\n---\n[![PyPI](https://img.shields.io/pypi/v/mwk-logger)](https://pypi.org/project/mwk-logger/)  \n**Custom logger with colors on terminal.**  \n![logger](https://user-images.githubusercontent.com/105928466/190899542-94a70a4d-ef1a-418a-90be-0143d3d1d630.JPG)  \n**And some useful decorators.**  \n![dec](https://user-images.githubusercontent.com/105928466/190899507-cfcefe55-b21a-4d3b-ae85-bce418121366.JPG)  \n![dec_log](https://user-images.githubusercontent.com/105928466/190899529-b147e76a-29f1-4383-9670-b24fbc02e4a5.JPG)  \n\n---\n\n## Installing package\n\n```\npip install mwk-logger\n```\n\n---\n\n## Using logger\n\n### 1. Get instance of mwk-logger\n```python\nfrom mwk_logger import MwkLogger\n\nlog = MwkLogger(name='mwk',\n                file='logger.log',\n                stream_level='DEBUG',\n                file_level='DEBUG',\n                time=True)\n```\n\n*keyword parameters:*  \n- *name* - name of the logger, by default = 'mwk',\n- *file* - path to file to log into, by default = 'mwk.log',\n- *stream_level* - logging level for terminal, by default = 'WARNING',\n- *file_level* - logging level for file, by default = None,\n- *time* - if timestamp should be added to terminal log, by default = False,\n\nLEVELS:\n **None** - no logging or:  \n '**DEBUG**', '**INFO**', '**WARNING**', '**ERROR**', '**CRITICAL**'.  \nIf both levels are set to **None** stream_level is changed to **WARNING**.  \nTimestamp is always added to file logs. One can set if timestamp will be added to terminal logs.  \n\n### 2. Logging  \n```python\nlog.debug('This is a debug message.')\nlog.info('This is an info message.')\nlog.warning('This is a warning message.')\nlog.error('This is an error message!')\nlog.critical('This is a critical message!!!')\nlog.exception('This is an exception message!')\n```\n\n---\n\n## Using decorators\n1. **@timer** - print or log the runtime of the decorated function\n2. **@f_sig** - print or log the signature and the return value of the decorated function  \n### 1. Decorator with no arguments\nPrints on screen.  \n```python\nfrom mwk_logger import timer, f_sig\n\n@timer\n@f_sig\ndef function(*args, **kwargs):\n    # ... some function ...\n    return 'something'\n```\n\n### 1. Decorator with arguments\nOutput is logged with provided logger with level = **INFO**.  \n!!! keyword ***logger*** is obligatory !!!\n```python\nfrom mwk_logger import MwkLogger, timer, f_sig\n\nlog = MwkLogger()\n\n@timer(logger=log)\n@f_sig(logger=log)\ndef function(*args, **kwargs):\n    # ... some function to be logged...\n    return 'something'\n```\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwksolution%2Fmwk-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwksolution%2Fmwk-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwksolution%2Fmwk-logger/lists"}