Open UlucFVardar opened 2 months ago
You can do all this with an alternative package, called ycecream (www.github.com/salabim/ycecream).
You can define multiple instances of ic
with their own output method to address this.
Smth like:
from icecream import IceCreamDebugger
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def error(input: str):
logger.error(input)
def debug(input: str):
logger.debug(input)
icd = IceCreamDebugger(outputFunction=debug)
ice = IceCreamDebugger(outputFunction=error)
ic is a great library, but I think it has one shortcoming.
When using it in a big project, it becomes critical to perform the print operation according to the logging level.
In my current codes, there is always a code add-on like the one below.
This is a big need to be added to the library!
OR
Using it like this will be very useful in projects.
Also, if the colors printed according to the logging level are changed, we will have a much more understandable print style.