r"""Disable all logging for the CAMEL library. This function sets the log level to a value higher than CRITICAL, effectively disabling all log messages, and adds a NullHandler to suppress any potential warnings about no handlers being found.
()
| 43 | |
| 44 | |
| 45 | def disable_logging(): |
| 46 | r"""Disable all logging for the CAMEL library. |
| 47 | |
| 48 | This function sets the log level to a value higher than CRITICAL, |
| 49 | effectively disabling all log messages, and adds a NullHandler to |
| 50 | suppress any potential warnings about no handlers being found. |
| 51 | """ |
| 52 | os.environ['CAMEL_LOGGING_DISABLED'] = 'true' |
| 53 | _logger.setLevel(logging.CRITICAL + 1) |
| 54 | # Avoid adding multiple NullHandlers |
| 55 | if not any( |
| 56 | isinstance(handler, logging.NullHandler) |
| 57 | for handler in _logger.handlers |
| 58 | ): |
| 59 | _logger.addHandler(logging.NullHandler()) |
| 60 | _logger.debug("Logging has been disabled.") |
| 61 | |
| 62 | |
| 63 | def enable_logging(): |
nothing calls this directly
no outgoing calls
no test coverage detected