In some environments, such as Google Colab, loggers have a root handling that did not mask sensitive values. As a result, secrets such as API keys appeared in the logs. The PR removes root handlers when they exist to ensure sensitive values are handler properly.
Testing
Run the following in a Colab notebook. You should see two log outputs, one with the API key masked and one with it exposed.
Summary
In some environments, such as Google Colab, loggers have a root handling that did not mask sensitive values. As a result, secrets such as API keys appeared in the logs. The PR removes root handlers when they exist to ensure sensitive values are handler properly.
Testing
Run the following in a Colab notebook. You should see two log outputs, one with the API key masked and one with it exposed.
Now replace the first cell with the following and rerun the Python code. Only the masked logging output should remain.