The function _reset_logging is responsible for resetting the logging system in Python. This includes setting the logging level of the root logger to INFO and resetting all loggers (including their handlers) to the same logging level. The primary task is to ensure that any previously set logging configurations are cleared, and the logging state is set to a known default state.
Expected Behavior:
The function does not take any inputs or return any values (it follows a void pattern).
After calling this function, all loggers should have their level set to INFO, and all their handlers should be removed (i.e., set to empty).
It handles the closing of handlers gracefully, suppressing any errors that may arise.
Edge Cases to Handle:
The function should properly manage loggers that may not yet have been initialized, avoiding any exceptions.
The function should ensure that logging levels for any existing logger beyond the root logger (including user-defined loggers) are also reset appropriately.
Note:
The solution should be placed in /app/solution.py and the function must be importable as: