Skip to main content

A colorful and less settings logger, based on built-in package `logging`.

Project description

Log Stacker

A colorful and less settings logger, based on the built-in package logging.

What is this?

Contain the following features with the minimum settings.

  • stream logger(Colorful Stream)
  • file logger(strip color tags)
  • remote logger(In progress)

How to use?

Step 1

  • Install
pip install log_stacker
  • Import module in your entry point at the top

entry point: startup python file, such as main.py run.py start_api.py etc.

Step 2

  • Basic setup
"""
start_api.py
"""

from log_stacker import LogStacker
LogStacker.logging(__file__)

or

  • Advance setup
"""
start_api.py
"""

from log_stacker import LogStacker
LogStacker.logging(
    entry_point='path/to/your/log',
    stream_level=LogStacker.WARNING,
    file_level=LogStacker.INFO,
    remote_level=None
)

Step 3

You can start logging in anywhere of your project!

Note: If you got an initialized warning, please make sure you initial LogStacker correctly at the begging of the file your are running.

"""
test.py which is called by start_api.py
"""

from log_stacker import LogStacker
try:
    1/0
except Exception as e:
    LogStacker.critical(e)
    LogStacker.error(e)
    LogStacker.warning(e, msg='It is a warning!')
    LogStacker.info('I wanna print something here!')
    LogStacker.debug()

History

# date version
0 2021/02/07 v0.0.1

v0.0.1

  • Beta version

If you like my work, please consider buying me a coffee or PayPal Thanks for your support! Cheers! 🎉 Buy Me A Coffee

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

LogStacker-0.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

LogStacker-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file LogStacker-0.0.1.tar.gz.

File metadata

  • Download URL: LogStacker-0.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.1

File hashes

Hashes for LogStacker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4f78c242a09cac8f8242bd142285cc2eff5d14ef41b3441dd65a6ba3aa9a0da4
MD5 d994c5d1ed629ef4b1e9bb9f2c694a64
BLAKE2b-256 3557de308734f213bab811fa57e355ffaae818635e533b57bad732c27a57260a

See more details on using hashes here.

File details

Details for the file LogStacker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: LogStacker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.1

File hashes

Hashes for LogStacker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95f31a88b1997809181579f7982e46a5a1a13bf6d7f3ba74d61bc36d63243c50
MD5 96ff511b411baf24bcd7b60c12b8d67a
BLAKE2b-256 e854017bcc9bf4e901cb6935a36abe085186ac862312619c698492eb07653b94

See more details on using hashes here.

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