Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

CentralLog helps recording the logs by MyOperator standards

Project description


CentralLog helps recording the logs by MyOperator standards.

The format of the log message is

    "mc_time":<unix-epoch in microseconds>,
    "service": <application/service name>,
    "class":"<source class name logging this>",
        "uid":"<unique log identifier>",
        "msg":"<actual message>",
        "acl":<acl numeric representation>
    "title": <logging context provider>

For description please refer to Documentation.


  • Auto-format log message to desired form by simply configuring the logger.


To install the centrallog package run the following commands:

$ git clone
$ pip install -e centrallog-py


For the impatient:

from myoperator.centrallog import centrallog
FORMAT = '%(name)s: (%(asctime)s) [%(levelname)s] - %(message)s'
logger = centrallog.getLogger('testlogger')
logger.error("Log message")


The basic configuration of logger is same as the python’s builtin logging library.

For customizing message-format use the following class methods.


This method is same as the logging’s basicConfig(**kwargs).

configure(servicename, hostname=’’, uid=’’)

This method is used to configure the servicename, the hostname, the uuid of the logger throughout the program.

TIP: Use this method once throughout the program before logging any message.


Check if a logger is configured and return true if it is configured, else false.


Returns the configuration tuple(servicename, hostname, uid).

Logging Methods

centrallog supports all the log methods of the logging library with an additional optional keyword-argument acl which shows the relevancy of the log.

The value of acl(Access Control List) can only be one of the following:

1 - developer (default)
2 - support
4 - customer

Example: To log an error message relevant to the customer(acl = 4).

logger.error('message', acl=4)

centrallog also provide some additional methods with default acl behaviour.

dlog(level, message, *args, **kwargs)

developer specific log(acl=1).

slog(level, message, *args, **kwargs)

support specific log(acl=2).

clog(level, message, *args, **kwargs)

customer specific log(acl=4).

Loggin with title

To add a title to the log message centrallog provide one of the two ways.

Using title keyword argument in every log message.

And using title(text) method.


logger.title('title here').dlog('message here')
logger.warning('message...', title='Title here')

Tip: On using both method and keyword, keyword will get higher precedence.

For further technical documentation please visit here.


0.1.0 (2020-01-04)

  • First release on PyPI.

Project details

Download files

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

Files for myoperator-py, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size myoperator_py-1.0.1-py2.py3-none-any.whl (11.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size myoperator_py-1.0.1.tar.gz (18.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page