Skip to content

p3titpoe/yail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yail

Yet Another Interactive Logger

Note

yail is still alpha, so changes may occur frequently

Features

yail is being developed with a 'coding phase first' approach,giving the user the ability to handle the log system like an audio console.

Analog to it, yail provides mute, solo, SIP, loglevel and group controls for logging to the terminal and other output handlers.

Loggers in yail can be locked to a certain log level and made shareable.

It features a simple template system for different log levels and overrides on an output handler basis.

Available Features

Note

As of April 2025

Management

  • Global Mute, Solo and Set Levels
  • Stop processing
  • Mute by log level
  • Grouping
  • Colored output

Loggers

  • Share logger
  • Block Logger at init level
  • Mute, Solo & Set level

Output Handlers

  • Console
  • File
  • Web
  • Socket

Basic Usage

Root Logger

yail gives you access to a console logger from the start.

import yail as logger

logger.info("Hello World")
logger.warning("Hello World! You are burning")

This is ok for small projects where you only need one logger and then filter by log level.
yail features an introspective package column tracking up to module level who called the log function.

Warning

The root logger is not affected by these functions:

  • mute
  • solo
  • processing
  • log level
Get a new logger

yail gives you enough flexibility for creating loggers as to adapt to most use cases.
For example, loggers are NOT shareable per default, but they can be set to public and so be retrieved everywhere yail is imported.

#main.py
import yail as logger
from yail import LoggerLevel

#public controls whether the logger can be called from another module
#block_level set to True blocks the logger at his initial loglevel to keep it safe from global level change
log = logger.get_logger(name='MyLogger',  
                        loglevel=LoggerLevel.INFO,
                        public=True, 
                        block_level=False
                        )

log.info("Hello World")
Get a created public logger
#other.py
import yail as logger

log = logger.logger_by_name('MyLogger')
log.info("Hello World")
Orchestrate loggers

Let's assume you have several loggers created through your code and are working on a specific part of it.
Sometimes you might want to single out different loggers or mute others to compare outputs for example.
As long as yail is imported you can control them from anywhere.

#another.py
import yail as logger

#mute function
logger.mute('MyLogger')
logger.mute('MyLogger4')

logger.muteall()
logger.muteoff()

#Solo In Place
logger.sip('MyLogger')
logger.sip() #offs the sip



About

Yail is yet another intercative logger

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages