I catch all the exceptions and log them with loguru logger. I then have to reraise the exception.
from loguru import logger
except Exception as e:
logger.error("Example exception log.")
raise e
------------------------
Console output:
...
... Example exception log.
I only want to see the log from loguru. I don't want any traceback or message of the exception from raising an unhandled exception in the console output.
How do I do it?
Take note that it completely silences stderr from this process, so it cause unintended changes to any other module also using stderr.