Skip to content

ILYXAAA/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger Library

What is this?

A simple module for color logging to the console/file

Installation

pip install ilyxalogger

Quick Guide

from ilyxalogger import Logger
Logger = Logger(colorize=True, write_to_logfile=True, log_filename="Logger.log")

Logger.log_info(message="Info")
Logger.log_success(message="Success")
Logger.log_warning(message="Warning")
Logger.log_error(message="Error", error=ValueError, solution="Potential solution")

Also if you add a symbol $, the framed text will be highlighted in color.

Example of output modification:

color = "\033[0;35m" # ANSII PURPLE
bg_color = "\033[41m" # ANSII RED, color for text in $..$
message="Some $warning$ message"
title="MyWarning"

log_warning(message=message, title=title, color=color, bg_color=bg_color)

Output example:

image

About

A class for beautifully displaying logs in the console

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages