Skip to main content

A Fast & Fancy version of logging

Project description

FancyLogger

Downloads Downloads Downloads
With this library, Log in style!

This library is still under development, so we appreciate if you help us improve it on the GitHub!

Having an issue?

You can always find someone on our discord server here:

https://discord.agmstudio.xyz/

Wiki

The official wiki of this library is now available at GitHub

https://git.agmstudio.xyz/FancyLogger/wiki

How to install

To install just use following command

pip install PyFancyLogger

This library will have dev/beta builds on the GitHub, to install them you can use

pip install --upgrade git+https://github.com/AGM-Studio/FancyLogger.git

Example

This is based on file below:

https://github.com/AGM-Studio/FancyLogger/blob/master/test.py

from FancyLogger import FancyLogger, FancyFormatter, Formats

logger = FancyLogger('Test', FancyFormatter(Formats.detailed))

logger.setLevel(0)

if __name__ == '__main__':
    logger.debug('This is a debug')
    logger.info('This is an info')
    logger.warning('This is a warning')

    try:
        int('Not an int')
    except Exception as e:
        logger.error(f'This is an error for {e}')

    try:
        int('Not an int either')
    except Exception as e:
        logger.exception(f'This is an error for {e}')

    logger.critical('IMPORTANT: THIS IS A CRITICAL MESSAGE')

    print('\n----- Testing Sub loggers -----\n')

    logger.sub('Sub 1').info('A sub to the parent')
    logger.sub('Sub 2').info('Another sub logger!')

    logger.sub('Sub 1').info('Previous one is still available!')
    logger.sub('Sub 1').sub('Sub in Sub').critical('EVEN SUBS CAN HAVE SUBS!')

Result

Advertisement Banner

Extras & Features

...

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

pyfancylogger-0.3.2.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

pyfancylogger-0.3.2-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

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