Mayil-AI-Sandbox / loguru-Jan2023

MIT License
0 stars 0 forks source link

Hide Sensitive Information from Exception Traceback (hashtag651) #71

Closed vikramsubramanian closed 2 months ago

vikramsubramanian commented 2 months ago

While there are ways to mask / scrub sensitive information from message as mentioned in

There should also be ways to mask / scrub sensitive information in exception traceback.

vikramsubramanian commented 2 months ago

You can do so by implementing a custom exception formatting and/or disabling diagnose option: [Customizing the formatting of exceptions](

vikramsubramanian commented 2 months ago

So, we are saying that the only option is to set diagose=False?

Disabling diagnose would stop printing all the values, even the ones which were not sensitive and useful.

It would be great if we can selectively disable some classes during diagnosis or configure a regex based replacement which is currently available for messages.

vikramsubramanian commented 2 months ago

There is currently no "regex based replacement" available for messages. One has to implement it's own filtering handler as described in the ticket you linked. I'm suggesting to do the same with a custom exception formatter. :+1: