All Projects → jacebrowning → minilog

jacebrowning / minilog

Licence: MIT license
Minimalistic wrapper for Python logging.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Labels

minilog

A minimalistic logging wrapper for Python.

Unix Build Status Windows Build Status Coverage Status Scrutinizer Code Quality PyPI License PyPI Version PyPI Downloads

Usage

Every project should utilize logging, but for simple use cases, this requires a bit too much boilerplate. Instead of including all of this in your modules:

import logging

log = logging.getLogger(__name__)

def greet(name):
    log.info("Hello, %s!", name)

if __name__ == "__main__":
    logging.basicConfig(
        level=logging.INFO,
        format="%(levelname)s: %(name)s: %(message)s",
    )

with this package you can simply:

import log

def greet(name):
    log.info("Hello, %s!", name)

if __name__ == "__main__":
    log.init()

It will produce the exact same standard library logging records behind the scenes with automatic formatting for non-strings.

Installation

Install this library directly into an activated virtual environment:

$ pip install minilog

or add it to your Poetry project:

$ poetry add minilog

Documentation

To view additional options, please consult the full documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].