Skip to main content

Log Better

Project description

LogPlus

Log Better

  • Free software: MIT license

  • Documentation: TBD

Installation

To install LogPlus:

pip install logplus

or

pip install git+https://github.com/tactlabs/logplus.git

Pip installing the library from local repository:

conda activate <env_name>

python setup.py install develop

Usage

To use LogPlus in a project:

import logplus

Sample

Example

import logplus

logger = logplus.get_logger()

result_json = {
    'result': 1,
    'a' : "two",
    'b' : {
        "one" : "two"
    }
}

logger.info('message test')
logger.info(result_json)
logger.debug('message debug')
logger.warning('message warning')
logger.error('message error')

Output

2024-05-12 16:29:28 info [~/projects/logger-base/test.py:28][startpy] message test

2024-05-12 16:29:28 info [~/projects/logger-base/test.py:29][startpy] {‘result’: 1, ‘a’: ‘two’, ‘b’: {‘one’: ‘two’}}

2024-05-12 16:29:28 debug [~/projects/logger-base/test.py:31][startpy] message debug

2024-05-12 16:29:28 warning [~/projects/logger-base/test.py:32][startpy] message warning

2024-05-12 16:29:28 error [~/projects/logger-base/test.py:33][startpy] message error

Credits

The base code is derived from StructLog (https://github.com/hynek/structlog).
As we see a lot of improvement in StructLog we came up with this library.

History

0.1.3 (2024-05-12)
------------------

* Docs updated


0.1.2 (2024-05-12)
------------------

* Base version derived from multiple libs.

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

logplus-0.1.3.tar.gz (49.5 kB view hashes)

Uploaded Source

Built Distribution

logplus-0.1.3-py3-none-any.whl (60.5 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