Skip to main content

logging in colour

Project description

technicolor

logging in colour

introduction

technicolor provides logging in colour and logging of function usage by means of a simple decorator.

quick start

In the main code of the program could be a technicolor logging setup such as the following:

global log
log = logging.getLogger(__name__)
logging.root.addHandler(technicolor.ColorisingStreamHandler())
if self.verbose:
    logging.root.setLevel(logging.DEBUG)
else:
    logging.root.setLevel(logging.INFO)

Then, in modules imported, there could be a logging setup such as the following:

log = logging.getLogger(__name__)

The function logging of technicolor logs the name of the function called, the caller of the function and the arguments of the function used. This functionality can be engaged by using a decorator in a way such as the following:

@technicolor.log
def function1(
    a,
    b,
    c = 4,
    d = 5,
    e = 6
    ):
    return(a + b + c + d + e)

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

technicolor-2015.12.2.1250.tar.gz (15.3 kB view details)

Uploaded Source

File details

Details for the file technicolor-2015.12.2.1250.tar.gz.

File metadata

File hashes

Hashes for technicolor-2015.12.2.1250.tar.gz
Algorithm Hash digest
SHA256 91ed0f3608a7095e6c50997eb0719ef12e10016da0151cc0b277ffa9a3235018
MD5 f7ae4657e67dad46b7accee6da9f9f8e
BLAKE2b-256 5773444b2b8db5c3e56de0c73a10388b306c6b9b8f91ef4582a4547b91f82fbc

See more details on using hashes here.

Supported by

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