Skip to main content

A generic logging package for python projects

Project description

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:

from aklogger import logger

logger.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 for more uses.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aklogger-0.1.2.tar.gz (3.9 kB view hashes)

Uploaded source

Built Distribution

aklogger-0.1.2-py3-none-any.whl (4.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page