[![License: GNU GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/ashfaque/AshLogger/blob/main/LICENSE)
## How to install
```sh
pip install AshLogger
```
## Documentation
```python3
from AshLogger import AshLogger
logger_obj = AshLogger(
file_name='logger_file_name.log' # If `file_name` is not given, it will set logger file name as `AshLogger.log`
, file_location=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs') # If log file path not given, it will create a log/ dir where the calling python file is located.
, max_bytes=20000 # default: 1000000
, max_backups=3 # default: 1
, logger_name='app1_logger'
)
logger = logger_obj.setup_logger() # `logger_obj.setup_basic_logger()` for no formattings like timestamps etc, in the log file after logging data.
# * Testing logger
logger.info(f'{1} info log')
logger.debug('%s debug log', 2)
logger.warning('{0} warning log'.format(3))
logger.error('4 error log')
# ! USE ANY ONE TYPE OF LOGGER IN A SINGLE FILE, EITHER ABOVE OR BELOW.
# No need to make object for the class AshLogger, as @classmethod is used as alternative constructor.
basic_logger = AshLogger.setup_basic_logger(
file_name='basic_logger_file_name.log' # If `file_name` is not given, it will set logger file name as `AshBasicLogger.log`.
, file_location=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs') # If log file path not given, it will create a log/ dir where the calling python file is located.
, logger_name='app1_logger'
)
# * Testing basic logger
basic_logger.info(f'{1} info log')
basic_logger.debug('%s debug log', 2)
basic_logger.warning('{0} warning log'.format(3))
basic_logger.error('4 error log')
```
## License
[GNU GPLv3](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/ashfaque/AshLogger",
"name": "AshLogger",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": null,
"keywords": "ASHFAQUE, ASHFAQUE ALAM, PYTHON, LOGGER, PYTHON LOGGER",
"author": "Ashfaque Alam",
"author_email": "ashfaquealam496@yahoo.com",
"download_url": "https://files.pythonhosted.org/packages/ec/b4/5efd4b59dc92c24748dae9e9bf38e5a874722927b5101cd292189170292f/AshLogger-0.5.tar.gz",
"platform": null,
"description": "[![License: GNU GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/ashfaque/AshLogger/blob/main/LICENSE)\r\n\r\n\r\n\r\n## How to install\r\n```sh\r\npip install AshLogger\r\n```\r\n\r\n\r\n\r\n## Documentation\r\n```python3\r\nfrom AshLogger import AshLogger\r\n\r\n\r\nlogger_obj = AshLogger(\r\n file_name='logger_file_name.log' # If `file_name` is not given, it will set logger file name as `AshLogger.log`\r\n , file_location=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs') # If log file path not given, it will create a log/ dir where the calling python file is located.\r\n , max_bytes=20000 # default: 1000000\r\n , max_backups=3 # default: 1\r\n , logger_name='app1_logger'\r\n )\r\n\r\nlogger = logger_obj.setup_logger() # `logger_obj.setup_basic_logger()` for no formattings like timestamps etc, in the log file after logging data.\r\n\r\n# * Testing logger\r\nlogger.info(f'{1} info log')\r\nlogger.debug('%s debug log', 2)\r\nlogger.warning('{0} warning log'.format(3))\r\nlogger.error('4 error log')\r\n\r\n\r\n# ! USE ANY ONE TYPE OF LOGGER IN A SINGLE FILE, EITHER ABOVE OR BELOW.\r\n\r\n\r\n# No need to make object for the class AshLogger, as @classmethod is used as alternative constructor.\r\nbasic_logger = AshLogger.setup_basic_logger(\r\n file_name='basic_logger_file_name.log' # If `file_name` is not given, it will set logger file name as `AshBasicLogger.log`.\r\n , file_location=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logs') # If log file path not given, it will create a log/ dir where the calling python file is located.\r\n , logger_name='app1_logger'\r\n )\r\n\r\n# * Testing basic logger\r\nbasic_logger.info(f'{1} info log')\r\nbasic_logger.debug('%s debug log', 2)\r\nbasic_logger.warning('{0} warning log'.format(3))\r\nbasic_logger.error('4 error log')\r\n```\r\n\r\n\r\n\r\n## License\r\n[GNU GPLv3](LICENSE)\r\n",
"bugtrack_url": null,
"license": "GNU GPLv3",
"summary": "Hassle free ready to use out of the box Python3 logger.",
"version": "0.5",
"project_urls": {
"Download": "https://github.com/ashfaque/AshLogger/archive/refs/tags/v_05.tar.gz",
"Homepage": "https://github.com/ashfaque/AshLogger"
},
"split_keywords": [
"ashfaque",
" ashfaque alam",
" python",
" logger",
" python logger"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ecb45efd4b59dc92c24748dae9e9bf38e5a874722927b5101cd292189170292f",
"md5": "fd3c672acfa50a97284cce529c3bdaf4",
"sha256": "78511b7e284701e71d5f1b8491d540cc8d386c45b14e957ec38e68022d00aadb"
},
"downloads": -1,
"filename": "AshLogger-0.5.tar.gz",
"has_sig": false,
"md5_digest": "fd3c672acfa50a97284cce529c3bdaf4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 17744,
"upload_time": "2024-06-22T18:04:47",
"upload_time_iso_8601": "2024-06-22T18:04:47.811834Z",
"url": "https://files.pythonhosted.org/packages/ec/b4/5efd4b59dc92c24748dae9e9bf38e5a874722927b5101cd292189170292f/AshLogger-0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-22 18:04:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ashfaque",
"github_project": "AshLogger",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ashlogger"
}