Odoo python client used at Alkivi
Project description
Python logger used at Alkivi
Package
Example
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 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
Built Distribution
Close
Hashes for alkivi_odoo_client-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c8681e2b44fdce18fe2802a3500c552fb5e19045b65c5406416013a9fdb0d39 |
|
MD5 | 1f8c346825b04d4677b4b968db7e4f79 |
|
BLAKE2b-256 | 19705eb232ab14a7ce1c247c950282694ede68341a196f1ad0f0242f278174d5 |