Skip to main content

Awesome and simple logger

Project description

Logo

loggissimo

Awesome and simple logger!

Authors

Usage/Examples

Use default logger from package.

from loggissimo import logger

logger.level = "TRACE"

logger.info("info")
logger.successs("success")
logger.warning("warning")
logger.error("error")
logger.critical("critical")

logger.debug("debug")
logger.trace("trace")
logger.destructor("destructor")

Create instance of logger with own format.

# Default format string - "format", "$name@ $time | $level | $stack: $text"

logger = Logger("my_logger", "$name | $time | $text")
logger.info("my own logger")

Get created instance by name.

log = Logger("my_logger")
my_log = Logger("my_logger")

log is my_log # True

Override default colors and styles.

logger = Logger(
        "my_logger",
        format="<font=cyan>$name | <style=bold bg=1,2,3 font=255,0,0>$time | <font=yellow bg=red>$text",
    )
logger.info("my own logger")

Add output streams.

logger.add("my_logger.log")
# or
file = open("my_logger.log", "w+")
logger.add(file)

Disable message from module.

# module/__init__.py
logger.disable()

# module/engine.py
def do_somthing():
    logger.info("I'm in module funtcion")

# main.py
do_somthing() # The output is empty

logger.enable("module")
do_somthing()
# @ 2024-05-31 16:23:43 | INFO     | __main__:main:27: I'm in module funtcion

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

loggissimo-0.2.0.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file loggissimo-0.2.0.tar.gz.

File metadata

  • Download URL: loggissimo-0.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for loggissimo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 602d93a14a79c9dc0d8ca9844bfb0db1f436077260f6173d60d72b7e4e490e2a
MD5 06c4f9d711fa008f523001813b79cc18
BLAKE2b-256 36b816092fdde1c2156fb3cfb18f14d59693fe44c9d8d75b19e3e4a9d822d607

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