Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/appknox/aklogger
Our generic logging service used in Appknox
https://github.com/appknox/aklogger
Last synced: about 2 months ago
JSON representation
Our generic logging service used in Appknox
- Host: GitHub
- URL: https://github.com/appknox/aklogger
- Owner: appknox
- License: mit
- Created: 2019-03-04T11:23:13.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-18T05:07:27.000Z (about 1 year ago)
- Last Synced: 2024-09-22T19:45:57.133Z (3 months ago)
- Language: Python
- Homepage: https://appknox.org
- Size: 102 KB
- Stars: 3
- Watchers: 13
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aklogger
Keep track of all the events happening in your project: A generic logging package for python projects.
## [Features]
- Logging to console
- Logging to file
- Push logs to slack## Installation
```
$ pip install aklogger
```## Usage
Following script will log messages to slack, file and console:
```python
from aklogger import loggerlogger.set_name('mycroft')
logger.setLevel('DEBUG')# This will log to console
logger.info('Some Dummy log', 'Some dummy details of the dummy log')# Enable File log
logger.log_to_file('file.log')# This will log to file and console
logger.info('Some Dummy log', 'Some dummy details of the dummy log')# Enable Slack
logger.enable_slack(SLACK_TOKEN)# Set slack level
logger.set_slack_level('WARNING')# Now the logs will be log to slack
logger.warning('Some Dummy log', 'Some dummy details of the dummy log')# You can also do a force push to slack no matter what the slack level is set.
logger.info('Dummy log', 'Details of the dummy log', force_push_slack=True)
```See [python logging docs](https://docs.python.org/3/library/logging.html) for more uses.