Skip to main content

Python logging extension

Project description

scia

GitHub license

Python logging extension - crogeo.org

Installation

  • From sources
git clone https://github.com/crogeo/scia.git
cd scia
pip install .
  • From PyPi
pip install scia

Documentation

  • Config file: log.ini
[loggers]
keys=root,daily

[handlers]
keys=console,daily

[formatters]
keys=fmt

[logger_root]
level=INFO
handlers=console
qualname=root
propagate=0

[logger_daily]
level=DEBUG
handlers=console,daily
qualname=%(project)s
propagate=0

[handler_daily]
class=scia.handlers.TimedRotatingFileHandler
level=DEBUG
formatter=fmt
args=('logs/%(project)s.log', 'midnight')

[handler_console]
class=StreamHandler
level=DEBUG
formatter=fmt
args=(sys.stdout,)

[formatter_fmt]
format=%(asctime)s - %(name)10s - %(levelname)8s - %(message)s
  • Usage
from scia import get_logger

log = get_logger('myproject')

log.debug('Debug message')
log.info('Info message')
log.warning('Warning message')
log.error('Error message')
  • Project name configuration
from scia import config

config.project = 'myproject' # The logger name and the filename: logs/myproject.log
config.inifile = 'log.ini'  # Configuration file

License

Crogeo scia is MIT licensed.

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

scia-1.0.2.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

scia-1.0.2-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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