Simple and colorful Python logging module
✨ fastlog: simple and colorful python logs ✨
Fastlog is designed to spice up your Python script logs with a simple but familiar interface.
- Works out-of-the-box
- Sleek defaults
- Simple, familiar
logging.Loggerinterface with new features
- Supports all terminal types (for Linux, Windows, MacOS, etc.)
- No external package dependencies
- Compatible with both Python 2.7 and Python 3
- Modular styles, but customization is not required
What is this for?
Fastlog is for anyone who writes quick scripts with lots of print statements but no time for Python's logging module.
Under the hood, fastlog wraps the same
logging.Logger module that Python developers are used to, but with colorful defaults and more features.
from fastlog import log log.setLevel(log.DEBUG) log.info("log.info") log.success("log.success") log.failure("log.failure") with log.indent(): log.debug("log.debug") log.warning("log.warning") log.separator() log.hexdump(list(map(chr, range(256))))
Installation and Usage
To install Fastlog, simply grab the PyPi package with pip.
$ pip install fastlog
To include fastlog in your script, add the following import:
from fastlog import log
Fastlog is documented using regular Python docstrings in the source code itself.
ReadTheDocs compilation is still pending.
Fastlog supports a modular style interface
# Import styles like python modules log.setStyle('fastlog.styles.pwntools')
This project is currently in Beta while I continue to improve some features.
There aren't any breaking changes planned, just additions of new features.
Is this just pwntools?
Fastlog was born out of a sadness for bland Python script outputs and a love of the logging module from the Pwntools project.
While there is some code taken between pwntools (specifically termcap and hexdump), the projects are completely independent.
Pwntools was also only Py2 compatible, where Fastlog is both Py2 and Py3 compatible.