{ "info": { "author": "oalieno", "author_email": "jeffrey6910@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# \ud83d\udda5 Consoly\n\nElegant Console Logger for Python\n\n![MIT](https://img.shields.io/github/license/oalieno/consoly.svg)\n\n## Installation\n\nFrom PyPI\n\n```bash\npip install consoly\n```\n\nFrom Github\n\n```bash\npip install git+https://github.com/OAlienO/consoly.git\n```\n\n## Getting Started\n\n```python\nfrom consoly import consoly\n\nconsoly.critical('Bomb!!')\nconsoly.error('Oh shit...')\nconsoly.warning('Chill')\nconsoly.info('Just some information')\nconsoly.debug('Fuck bugs')\n```\n\n\n\n```python\nfrom consoly import consoly\n\nconsoly.level = consoly.DEBUG\nconsoly.defaults = { 'badge': True, 'time': True }\n\nconsoly.critical('Bomb!!')\nconsoly.error('Oh shit...')\nconsoly.warning('Chill')\nconsoly.info('Just some information')\nconsoly.debug('Fuck bugs')\n```\n\n\n\n## Document\n\n### type of levels\n\n| type | level | alias |\n| --- | --- | --- |\n| critical | 50 | consoly.CRITICAL |\n| error | 40 | consoly.ERROR |\n| warning | 30 | consoly.WARNING |\n| info | 20 | consoly.INFO |\n| debug | 10 | consoly.DEBUG |\n\n#### custom type of level\n\n```python\nconsoly.types['success'] = {\n 'level': 25,\n 'color': Color.green,\n 'icon': '\u2714'\n}\nconsoly.level = consoly.SUCCESS\nconsoly.success('it works')\n```\n\n### Consoly\n\ndefault instance `consoly` is created by [`Consoly(FancyFormatter())`](/consoly/__init__.py#L5)\n\n#### `consoly.level`\n\ndefault to `0` ( print every messages )\n\n```python\nconsoly.level = consoly.ERROR\n```\n\n#### `consoly.defaults`\n\ndefault to `{}`\n\nthis is the default options pass to formatter\n\n```python\nconsoly.defaults = { 'badge': True }\n```\n\n#### `consoly.types`\n\nsee [type of levels](#type-of-levels)\n\n#### `consoly.formatter`\n\nsee [Formatter](#formatter)\n\n### Formatter\n\ndefault formatter is [FancyFormatter](/consoly/formatter/fancyFormatter.py)\n\n#### FancyFormatter\n\noption for FancyFormatter\n\n```python\n# set option default\nconsoly.defaults = { 'badge': True, 'time': True, 'short': True }\nconsoly.debug('hello')\n\n# set option directly\nconsoly.debug('hello', badge = True, time = True, short = True)\n```\n\n\n\n#### set output file ( default is sys.stdout )\n\n```python\nconsoly.formatter.file = open('service.log', 'w')\n```\n\n#### custom formatter\n\n```python\nfrom consoly import Formatter\n\nclass MyFormatter(Formatter):\n def format(self, text, typeData, formatData):\n name = typeData['name']\n color = typeData['color']\n bold = formatData.get('bold', False)\n if bold: color = color.bold\n self.write(f'{color.paint(name)} - {text}')\n\nconsoly.formatter = MyFormatter()\n```\n\nFor example `consoly.error('test', testOption = 10)`\n\n##### `text` will be `test`\n\n##### `typeData` will be\n\n```python\n{\n 'name': 'error',\n 'level': 40,\n 'color': Color.red,\n 'icon': '\u2716'\n}\n```\n\n##### `formatData` will be\n\n```python\n{\n 'testOption': 10\n}\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/OAlienO/consoly", "keywords": "color console terminal ansi text hues logging logger", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "consoly", "package_url": "https://pypi.org/project/consoly/", "platform": "", "project_url": "https://pypi.org/project/consoly/", "project_urls": { "Homepage": "https://github.com/OAlienO/consoly" }, "release_url": "https://pypi.org/project/consoly/0.0.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "elegant console logger for python", "version": "0.0.1" }, "last_serial": 5112151, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2f33b3c7eccd80537f9820035cf31660", "sha256": "72969625720ac6ad519ed65973ae0b3db0a8e30bac3d004e4c6e24decf755951" }, "downloads": -1, "filename": "consoly-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2f33b3c7eccd80537f9820035cf31660", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5906, "upload_time": "2019-04-08T06:17:00", "url": "https://files.pythonhosted.org/packages/f8/40/6234ca124e259bd6dd66c72fd8720da81d0dc57997eaf45d35c02e479eeb/consoly-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "163e4cdf357ec281eb778e81bf8a7829", "sha256": "67c6389b5c9979d43189a6fbdf5cdc232b4e03d3893015dcb0bf858ebe7759a3" }, "downloads": -1, "filename": "consoly-0.0.1.tar.gz", "has_sig": false, "md5_digest": "163e4cdf357ec281eb778e81bf8a7829", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4079, "upload_time": "2019-04-08T06:17:02", "url": "https://files.pythonhosted.org/packages/06/22/b334d34af8ede360f0b14a9413208edc13a3720dd19ee5b51ef607da74fc/consoly-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f33b3c7eccd80537f9820035cf31660", "sha256": "72969625720ac6ad519ed65973ae0b3db0a8e30bac3d004e4c6e24decf755951" }, "downloads": -1, "filename": "consoly-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2f33b3c7eccd80537f9820035cf31660", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5906, "upload_time": "2019-04-08T06:17:00", "url": "https://files.pythonhosted.org/packages/f8/40/6234ca124e259bd6dd66c72fd8720da81d0dc57997eaf45d35c02e479eeb/consoly-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "163e4cdf357ec281eb778e81bf8a7829", "sha256": "67c6389b5c9979d43189a6fbdf5cdc232b4e03d3893015dcb0bf858ebe7759a3" }, "downloads": -1, "filename": "consoly-0.0.1.tar.gz", "has_sig": false, "md5_digest": "163e4cdf357ec281eb778e81bf8a7829", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4079, "upload_time": "2019-04-08T06:17:02", "url": "https://files.pythonhosted.org/packages/06/22/b334d34af8ede360f0b14a9413208edc13a3720dd19ee5b51ef607da74fc/consoly-0.0.1.tar.gz" } ] }