Skip to main content

Python logger used at Alkivi

Project description

python-alkivi-logger
==========================

[![Build Status](https://travis-ci.org/alkivi-sas/python-alkivi-logger.svg?branch=master)](https://travis-ci.org/alkivi-sas/python-alkivi-logger)
[![Requirements Status](https://requires.io/github/alkivi-sas/python-alkivi-logger/requirements.svg?branch=master)](https://requires.io/github/alkivi-sas/python-alkivi-logger/requirements/?branch=master)

Python logger used at Alkivi

## Package

Example

```python
from alkivi import logger as _logger
import logging

#
# Define Logger
#
logger = _logger.Logger(
min_log_level_to_mail = logging.ERROR,
min_log_level_to_save = logging.DEBUG,
min_log_level_to_print = logging.DEBUG,
min_log_level_to_syslog = None,
emails=['anthony@alkivi.fr'])

#
# Basic usage
#
logger.debug_debug('This is a very low level debug')
logger.debug('This is a debug comment')
logger.log('This is a basic log')
logger.info('This is a info comment')
logger.important('This is an important comment')
logger.warning('This is a warning comment')
logger.error('This is a error comment')
logger.critical('THis is very dangerous, please have a look !')

#
# Now let's do some loop
#
logger.new_loop_logger()
for i in range(0, 11):
logger.new_iteration(prefix='i=%i' % (i))
logger.debug("We are now prefixing all logger")
if i == 9:
logger.debug("Lets do another loop")
logger.new_loop_logger()
for j in range(0, 5):
logger.new_iteration(prefix='j=%i' % (j))
logger.debug("Alkivi pow@")

# Dont forget to close logger or shit will happen
logger.del_loop_logger()

logger.del_loop_logger()
logger.debug('We now remove an loop, thus a prefix')
```

## Tests

Testing is set up using [pytest](http://pytest.org) and coverage is handled
with the pytest-cov plugin.

Run your tests with ```py.test``` in the root directory.

Coverage is ran by default and is set in the ```pytest.ini``` file.
To see an html output of coverage open ```htmlcov/index.html``` after running the tests.

TODO

## Travis CI

There is a ```.travis.yml``` file that is set up to run your tests for python 2.7
and python 3.2, should you choose to use it.

TODO

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

alkivi-logger-1.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

alkivi_logger-1.0.0-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file alkivi-logger-1.0.0.tar.gz.

File metadata

File hashes

Hashes for alkivi-logger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9d0601cda3aa2053a3ebee0e1840b589b7d12d6e33531902ff116d85ce33c53
MD5 9bd7b978f9ab50730b04447da1835458
BLAKE2b-256 6e650c8dea8eb97ab8825f64235dfb7c8b8a66016e5ade1201f518d5f1efef77

See more details on using hashes here.

Provenance

File details

Details for the file alkivi_logger-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for alkivi_logger-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 afb556e7362e09f416981ce56ffeede2d43739172e66db39fdfe399ed36db0ab
MD5 8794994ed02070c265c2d3253fd56df0
BLAKE2b-256 ac172d3d7da1dc93df2349ce3748238d8f035876ec2bfe299ec7acdcecb89196

See more details on using hashes here.

Provenance

Supported by

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