Skip to main content

A python module with sensible defaults for logging

Project description

  • version number: 0.0.1

  • date: 2016.11.10

  • author: Andrew J. Todd esq.

Overview

A python module to allow you to log. It’s a wrapper around the standard logging module with sensible defaults and as little configuration as possible.

Installation

To install use pip:

$ pip install simple_log

Or clone the repo:

$ hg clone https://bitbucket.org/andy47/simple_log $ python setup.py install

Usage

We try and stay true to the name and make using this module as simple as possible. For the simplest case just use

>>> from simple_log import get_log
>>> my_log = get_log()
>>> my_log.info("This is an information message")
2016.11.10 22:21:51 INFO:: This is an information message

If you want to have multiple logs just pass a name to get_log

>>> second_log = get_log('two')
>>> second_log.debug("This is a debug message")

By default the logging level is set to ‘INFO’ (the standard module defaults to ‘WARN’). See the [logging tutorial](https://docs.python.org/3/howto/logging.html#logging-basic-tutorial) for information on logging levels. If you would like to change the logging level, for instance to display ‘DEBUG’ messages use the set_level function

>>> from simple_log import get_log, set_level
>>> my_log = get_log('test_log')
>>> my_log.debug('This is the first debug message')
...
>>> set_level('test_log', 'DEBUG')
>>> my_log.debug('This is the second debug message')
2016.11.10 22:34:55 DEBUG:: This is the second debug message

Contributing

If you would like to contribute please add a pull request - https://bitbucket.org/andy47/simple_log/pull-requests/

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

simple_log-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

simple_log-0.0.1-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file simple_log-0.0.1.tar.gz.

File metadata

  • Download URL: simple_log-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simple_log-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0006e5005318e5298fcb89df71541f811f6a65006d502663789ee7ecf96eabd1
MD5 f245b09768d087fc45709b1fe9bb33f6
BLAKE2b-256 f310bfe52d92b82889249d251cf91330e84e735bf1329e7f28a93f5b1f79c330

See more details on using hashes here.

File details

Details for the file simple_log-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for simple_log-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0ab233f3e40f63d08711064bd024164f0cb53981395f12743b1b41c8c68dc87
MD5 774d3f3835dead56ecf6ce4d66c83ca0
BLAKE2b-256 5c8e9245ed3a4e2330e589729bd11bff0ae4253bb9b7fad2489e4d15c907d0a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page