MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / disable_logging

Function disable_logging

camel/logger.py:45–60  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

43
44
45def 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
63def enable_logging():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected