Skip to content
/ kellog Public

Extremely easy to use python print() replacement with coloured output and status icons.

License

Notifications You must be signed in to change notification settings

celynw/kellog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kellog

Extremely easy to use python print() replacement with coloured output and status icons.

Installation

pip install kellog

Requires python version 3.7 or above.

Usage

It is very very simple to start using this right away:

from kellog import debug, info, warning, error, critical

debug("Debug message")
info(f"Five plus six is {5 + 6}")
warning("f-strings are better than", "comma-separated", "arguments")
error("Exception")
critical("DEFCON 1")

image

kellog wraps the built-in logging library, so it can be controlled in the same ways. For instance, logging to file and configuring the output format.

class Kellog(
	path: Path | None,
	name: str,
	prefixes: dict[str, str] | None,
	append: bool,
)

Parameters
----------
path, optional
  Output file, by default None
name, optional
  Reset the logger name to this, by default "kellog"
prefixes, optional
  Set the log message prefixes (does not automatically add separating whitespace), by default None.
  The dictionary keys to set are "debug", "info", "warning", "error", "critical".
  Setting to None will use the default unicode prefixes, from codicons:      .
append, optional
  If False, delete the contents of `path` first, by default True

Tests

Install this package with:

pip install -e .[dev]

Then run the tests:

make tests

About

Extremely easy to use python print() replacement with coloured output and status icons.

Resources

License

Stars

Watchers

Forks

Packages

No packages published