Skip to content

Gbps/fastlog

Repository files navigation

✨ fastlog: simple and colorful python logs ✨

PyPi Badge

Fastlog is designed to spice up your Python script logs with a simple but familiar interface.

Features

  • Works out-of-the-box
  • Sleek defaults
  • Simple, familiar logging.Logger interface with new features
  • Supports all modern VT-emulated terminals
  • Small footprint
  • 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.

Example

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))))

Example Console Output

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

Documentation

Fastlog is documented using regular Python docstrings in the source code itself.

ReadTheDocs compilation is still pending.

Modular styles

Fastlog supports a modular style interface

# Import styles like python modules
log.setStyle('fastlog.styles.pwntools')

Check out the default style to see how it works.

Project Status

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.

Windows does not come with the curses module, which means there's still work needing to be done to support native Windows.

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.

About

✨Simple and colorful Python logging module ✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages