Skip to main content

Logging package with color and encryption support

Project description

dcclog

dcclog is a simple wrapper around the python logging module that makes it easy to colorize and encrypt log messages.

Installation

From pypi:

$ pip install dcclog

with built-in ciphers:

$ pip install 'dcclog[cipher]'

From github:

$ git clone https://github.com/jamazi/dcclog.git
$ cd dcclog
$ pip install '.[all]'

How To use dcclog

import dcclog

dcclog.default_config()
logger = dcclog.getLogger(name=__name__)

logger.error("error message.")
logger.warning("warning message.")
logger.info("info message.")
logger.debug("debug message.")


@dcclog.log
def logged_function(x: int, y: int) -> int:
    return x + y


logged_function(4, 6)

or with RSA encryption:

import dcclog
from dcclog.cipher.rsa import RSAEncryption

dcclog.default_config(
    level=dcclog.INFO,
    filename=".logs/app.log",
    cipher=RSAEncryption("pubkey.pem"),
)
logger = dcclog.getLogger(name=__name__)

logger.error("error message.")
logger.warning("warning message.")
logger.info("info message.")
logger.debug("debug message.")


@dcclog.log
def logged_function(x: int, y: int) -> int:
    return x + y


logged_function(4, 6)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

dcclog-0.10.0-py3-none-any.whl (12.4 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