Skip to main content

Loghandler

Project description

Logging Module

This library can handle colored log-output and write directly into a logfile.

Init

#!/usr/bin/env python3

from logbuddy import logbuddy

log = logbuddy.log()

Loglevel

At the moment there are a few loglevels defined by default.

  • Info
  • Warning
  • Error
  • Pass
  • Debug
log.Pass("I am a pass-message")
log.Warn("I am a warning-message")
log.Error("I am an error-message")
log.Debug("I am a debug-message")
log.Info("I am an info-message")

Change the color of the levels

log.Info("I am an info-message")

log.setInfo("\x1b[1;36m")

log.Info("And now I have a different color")

If you don't like colors

log.setColor(False)

Need a logfile?

log.setLogfile("somelogfile")

Need a logfile with date?

log.setLogfile("somelogfile")
log.setLogfileDate(True)

Future Plans

  • Creating your own loglevels

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 logbuddy, version 0.0.1.7
Filename, size File type Python version Upload date Hashes
Filename, size logbuddy-0.0.1.7-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size logbuddy-0.0.1.7.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page