loguru icon indicating copy to clipboard operation
loguru copied to clipboard

Hide Sensitive Information from Exception Traceback

Open DhavalShewale opened this issue 3 years ago • 3 comments

While there are ways to mask / scrub sensitive information from message as mentioned in https://github.com/Delgan/loguru/issues/17

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

DhavalShewale avatar May 05 '22 17:05 DhavalShewale

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

Delgan avatar May 05 '22 18:05 Delgan

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.

DhavalShewale avatar May 05 '22 18:05 DhavalShewale

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:

Delgan avatar May 05 '22 18:05 Delgan