### TimeoutCounter Eager Start Example Source: https://context7.com/intel/mfd-common-libs/llms.txt Illustrates using TimeoutCounter with `first_check_start=False` to begin timing immediately upon object construction, rather than on the first boolean evaluation. ```python # --- Start clock at construction, not at first check --- timeout_eager = TimeoutCounter(10, first_check_start=False) sleep(5) print(bool(timeout_eager)) # False — 5s of 10s elapsed sleep(6) print(bool(timeout_eager)) # True — 11s total elapsed ``` -------------------------------- ### TimeoutCounter Basic Usage Source: https://context7.com/intel/mfd-common-libs/llms.txt Demonstrates the basic usage of TimeoutCounter, including starting the timer on the first check and checking if the deadline has passed. ```python from time import sleep from mfd_common_libs import TimeoutCounter # --- Basic usage: start timing on first bool() check --- timeout = TimeoutCounter(5) # 5-second window print(bool(timeout)) # False — clock starts now sleep(6) print(bool(timeout)) # True — deadline passed ``` -------------------------------- ### OS Supported Decorator Example Source: https://context7.com/intel/mfd-common-libs/llms.txt Demonstrates the OSSupportedDecoratorError when a connection is not passed as a keyword argument to a decorated function. Ensure the connection object is passed correctly to avoid this error. ```python @os_supported(OSName.LINUX) def setup(positional_conn): # connection not passed as keyword arg pass try: setup(conn_linux) except OSSupportedDecoratorError as e: print(f"Decorator error: {e}") ``` -------------------------------- ### Developer Certificate of Origin Example Source: https://github.com/intel/mfd-common-libs/blob/main/CONTRIBUTING.md A standard certification that contributors must agree to, confirming they have the right to submit the code under the project's license. ```text Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` -------------------------------- ### Register Logging Levels with add_logging_group Source: https://context7.com/intel/mfd-common-libs/llms.txt Use `add_logging_group` to register all logging levels within a `LevelGroup` at once. This simplifies setup compared to adding each level individually. `LevelGroup.MFD` also includes `MODULE_DEBUG`. ```python import logging from mfd_common_libs import add_logging_group, LevelGroup, log_levels # Register all TEST levels at once (TEST_PASS=29, TEST_FAIL=28, TEST_STEP=27, # TEST_INFO=23, TEST_DEBUG=16) add_logging_group(LevelGroup.TEST) # Register all BL levels (BL_STEP=26, BL_INFO=22, BL_DEBUG=15) add_logging_group(LevelGroup.BL) # Register all MFD levels + MODULE_DEBUG (MFD_STEP=25, MFD_INFO=21, # MFD_DEBUG=14, MODULE_DEBUG=13) add_logging_group(LevelGroup.MFD) logger = logging.getLogger("my_test") logging.basicConfig(level=log_levels.MODULE_DEBUG) logger.log(log_levels.TEST_STEP, "Step 1: Connect to DUT") # Output: TEST_STEP:my_test:Step 1: Connect to DUT logger.log(log_levels.BL_INFO, "Configuring NIC parameters") # Output: BL_INFO:my_test:Configuring NIC parameters logger.log(log_levels.TEST_PASS, "Throughput test PASSED (9.8 Gbps)") # Output: TEST_PASS:my_test:Throughput test PASSED (9.8 Gbps) logger.log(log_levels.TEST_FAIL, "Latency test FAILED (expected <1ms, got 3ms)") # Output: TEST_FAIL:my_test:Latency test FAILED (expected <1ms, got 3ms) ``` -------------------------------- ### Custom Log Levels Reference Source: https://context7.com/intel/mfd-common-libs/llms.txt Shows how to access and use custom numeric log level constants from mfd_common_libs.log_levels. It also provides an example of setting up basic logging configuration for full MFD verbosity. ```python from mfd_common_libs import log_levels # Numeric values (lower = more verbose) print(log_levels.OUT) # 11 print(log_levels.CMD) # 12 print(log_levels.MODULE_DEBUG) # 13 print(log_levels.MFD_DEBUG) # 14 print(log_levels.BL_DEBUG) # 15 print(log_levels.TEST_DEBUG) # 16 print(log_levels.MFD_INFO) # 21 print(log_levels.BL_INFO) # 22 print(log_levels.TEST_INFO) # 23 print(log_levels.MFD_STEP) # 25 print(log_levels.BL_STEP) # 26 print(log_levels.TEST_STEP) # 27 print(log_levels.TEST_FAIL) # 28 print(log_levels.TEST_PASS) # 29 ``` ```python import logging from mfd_common_libs import add_logging_group, LevelGroup add_logging_group(LevelGroup.MFD) add_logging_group(LevelGroup.BL) add_logging_group(LevelGroup.TEST) logging.basicConfig( level=log_levels.OUT, # capture everything including command output format="%(levelname)-12s %(name)s: %(message)s" ) ``` -------------------------------- ### TimeoutCounter Polling Loop Example Source: https://context7.com/intel/mfd-common-libs/llms.txt Shows how to use TimeoutCounter within a polling loop to retry an operation until a condition is met or a timeout occurs. Raises TimeoutError if the service does not become ready within the specified time. ```python # --- Polling loop: retry until condition or timeout --- def wait_for_service(check_fn, timeout_sec: float = 30, poll_interval: float = 1): timeout = TimeoutCounter(timeout_sec) while not timeout: if check_fn(): return True sleep(poll_interval) else: raise TimeoutError(f"Service did not become ready within {timeout_sec}s") ``` -------------------------------- ### Enforce OS Compatibility with os_supported Decorator Source: https://context7.com/intel/mfd-common-libs/llms.txt The `os_supported` decorator checks if a `Connection` object's OS is in an allowed list, raising `UnexpectedOSException` if not. It skips checks if `mfd_connect` is not installed and raises `OSSupportedDecoratorError` if no `Connection` is found. ```python from mfd_connect import SSHConnection from mfd_typing import OSName from mfd_common_libs import os_supported from mfd_common_libs.exceptions import UnexpectedOSException, OSSupportedDecoratorError # --- Direct decoration on __init__ --- class NicModule: """Module that only supports Linux and FreeBSD.""" @os_supported(OSName.LINUX, OSName.FREEBSD) def __init__(self, *, connection): self._conn = connection conn_linux = SSHConnection(ip="10.0.0.1", username="root", password="pass") nic = NicModule(connection=conn_linux) # OK if conn_linux reports LINUX conn_windows = SSHConnection(ip="10.0.0.2", username="admin", password="pass") try: nic_win = NicModule(connection=conn_windows) except UnexpectedOSException as e: print(f"Blocked: {e}") # Blocked: Found unexpected OS: windows # --- Inheritance pattern: apply to parent's __init__ --- class BaseModule: def __init__(self, *, connection): self._conn = connection class LinuxOnlyModule(BaseModule): __init__ = os_supported(OSName.LINUX)(BaseModule.__init__) def get_interfaces(self) -> list: return self._conn.execute_command("ip -br link").splitlines() ``` -------------------------------- ### TimeoutCounter Source: https://context7.com/intel/mfd-common-libs/llms.txt TimeoutCounter wraps elapsed-time logic into a boolean-coercible object. bool(counter) returns False while time remains and True once the deadline is reached. The clock can start on the first bool() evaluation or at construction. ```APIDOC ## TimeoutCounter ### Description Manages polling-loop timeouts by providing a boolean-coercible object that indicates if a deadline has been reached. The timer can start on the first check or upon object instantiation. ### Usage ```python from time import sleep from mfd_common_libs import TimeoutCounter # Basic usage: start timing on first bool() check timeout = TimeoutCounter(5) # 5-second window print(bool(timeout)) # False — clock starts now sleep(6) print(bool(timeout)) # True — deadline passed # Polling loop: retry until condition or timeout def wait_for_service(check_fn, timeout_sec: float = 30, poll_interval: float = 1): timeout = TimeoutCounter(timeout_sec) while not timeout: if check_fn(): return True sleep(poll_interval) else: raise TimeoutError(f"Service did not become ready within {timeout_sec}s") # Start clock at construction, not at first check timeout_eager = TimeoutCounter(10, first_check_start=False) sleep(5) print(bool(timeout_eager)) # False — 5s of 10s elapsed sleep(6) print(bool(timeout_eager)) # True — 11s total elapsed ``` ``` -------------------------------- ### Generate Sphinx Docs Source: https://github.com/intel/mfd-common-libs/blob/main/sphinx-doc/README.md Run this command in the activated virtual environment within the MFD-Common-libs directory to generate the Sphinx documentation. ```shell $ python generate_docs.py ``` -------------------------------- ### os_supported Decorator Source: https://github.com/intel/mfd-common-libs/blob/main/README.md A decorator that checks if the OS of the connected device is supported. It raises exceptions if the connection object is missing or the OS is unexpected. ```APIDOC ## os_supported ### Description It's a decorator, which checks if OS of connected device is expected/supported. It can be used in implementation of modules. Requires `Connection` object from `mfd_connect` as argument in function! ### Params * handle OSName written as python arguments eg. `@os_supported(OSName.LINUX)` or `@os_supported(OSName.LINUX, OSName.WINDOWS)` ### Raises `OSSupportedDecoratorError`if not found necessary 'connection' and `UnexpectedOSException` when OS is unexpected. ### Usage Usually usage: ```python from mfd_common_libs import os_supported from mfd_typing import OSName class MyModule: """My module.""" @os_supported(OSName.LINUX, OSName.WINDOWS, OSName.FREEBSD) def __init__(self, *, connection): self._conn = connection ``` When your class doesn't have implemented custom `__init__`, but uses from parent, you need to define `__init__` like as bottom: ```python from mfd_common_libs import os_supported from mfd_typing import OSName class MyModule: """My module.""" def __init__(self, *, connection): self._conn = connection class MyModuleWithInherit(MyModule): """My child module.""" __init__ = os_supported(OSName.LINUX)(MyModule.__init__) def some_method(self): pass ``` ``` -------------------------------- ### add_logging_level Registering Custom Levels Source: https://context7.com/intel/mfd-common-libs/llms.txt Demonstrates registering individual custom log levels like CMD, MODULE_DEBUG, and MFD_DEBUG using `add_logging_level`. This function is idempotent and safely handles re-registration. ```python import logging from mfd_common_libs import add_logging_level from mfd_common_libs import log_levels # Register individual custom levels add_logging_level("CMD", log_levels.CMD) # 12 add_logging_level("MODULE_DEBUG", log_levels.MODULE_DEBUG) # 13 add_logging_level("MFD_DEBUG", log_levels.MFD_DEBUG) # 14 logger = logging.getLogger(__name__) logging.basicConfig(level=log_levels.CMD) # show everything from CMD (12) up logger.log(level=log_levels.CMD, msg="ssh root@host 'uname -a'") # Output: CMD:__main__:ssh root@host 'uname -a' logger.log(level=log_levels.MODULE_DEBUG, msg="Entering retry block") # Output: MODULE_DEBUG:__main__:Entering retry block # Safe to call again — no-op if level_name already registered add_logging_level("CMD", log_levels.CMD) # silently ignored ``` -------------------------------- ### Check OS Support with os_supported Decorator Source: https://github.com/intel/mfd-common-libs/blob/main/README.md This decorator verifies if the connected device's OS is supported. It requires a 'connection' object to be passed to the decorated function. It raises OSSupportedDecoratorError if 'connection' is missing or UnexpectedOSException if the OS is not in the allowed list. ```python from mfd_common_libs import os_supported from mfd_typing import OSName class MyModule: """My module.""" @os_supported(OSName.LINUX, OSName.WINDOWS, OSName.FREEBSD) def __init__(self, *, connection): self._conn = connection ``` ```python from mfd_common_libs import os_supported from mfd_typing import OSName class MyModule: """My module.""" def __init__(self, *, connection): self._conn = connection class MyModuleWithInherit(MyModule): """My child module.""" __init__ = os_supported(OSName.LINUX)(MyModule.__init__) def some_method(self): pass ``` -------------------------------- ### os_supported Source: https://context7.com/intel/mfd-common-libs/llms.txt `os_supported` is a decorator that enforces OS compatibility by checking the `Connection` object's OS against an allowed list. It raises `UnexpectedOSException` if the OS is not supported or `OSSupportedDecoratorError` if a `Connection` instance cannot be found. ```APIDOC ## `os_supported` — Decorator to enforce OS compatibility ### Description A decorator that validates the operating system of a device based on a provided `Connection` object. It ensures that the decorated function or method is only executed on systems matching the specified OS names. ### Usage ```python from mfd_connect import SSHConnection from mfd_typing import OSName from mfd_common_libs import os_supported @os_supported(OSName.LINUX, OSName.FREEBSD) def my_method(connection): # Method logic here pass # Example usage: # conn = SSHConnection(ip='...', connection_type='ssh') # my_method(connection=conn) ``` ### Parameters - ***os_names** (`OSName`) - Required - One or more `OSName` enum values specifying the allowed operating systems. ### Raises - `UnexpectedOSException`: If the OS of the connected device is not in the `os_names` list. - `OSSupportedDecoratorError`: If no `Connection` instance is found among the keyword arguments passed to the decorated function/method. ### Notes - The check is skipped if `mfd_connect` is not installed. - Can be applied directly to methods or used in inheritance patterns. ``` -------------------------------- ### Log Function Information with log_func_info Decorator Source: https://github.com/intel/mfd-common-libs/blob/main/README.md This decorator logs the name and arguments of a decorated method using a provided logger. Ensure a logger object is initialized and configured before applying this decorator. ```python import logging from mfd_common_libs import log_func_info logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) @log_func_info(logger) def calling_someone(someone): pass calling_someone('Adam') ``` -------------------------------- ### log_func_info Source: https://context7.com/intel/mfd-common-libs/llms.txt `log_func_info` is a parametric decorator that logs a function's name along with all positional arguments and keyword arguments at `MODULE_DEBUG` level (13) each time the function is called. It uses `functools.wraps` to preserve the wrapped function's metadata. The `MODULE_DEBUG` level is automatically registered when `log_func_info` is imported. ```APIDOC ## `log_func_info` — Decorator to trace function calls at MODULE_DEBUG ### Description A decorator that logs function calls, including their name and arguments, at the `MODULE_DEBUG` log level. This is useful for tracing execution flow and debugging. ### Usage ```python import logging from mfd_common_libs import log_func_info logger = logging.getLogger(__name__) @log_func_info(logger) def my_function(arg1, arg2=None): pass my_function('value1', arg2='value2') ``` ### Parameters - **logger** (`logging.Logger`) - Required - The logger instance to use for output. ### Notes - The `MODULE_DEBUG` log level (13) is automatically registered upon import. - Uses `functools.wraps` to maintain the original function's metadata. ``` -------------------------------- ### add_logging_group Source: https://context7.com/intel/mfd-common-libs/llms.txt `add_logging_group` registers all levels belonging to a `LevelGroup` in one call, replacing the need to call `add_logging_level` for each member. `LevelGroup.MFD` additionally includes `MODULE_DEBUG` as an alias for low-level module tracing. ```APIDOC ## `add_logging_group` — Register all levels in a named group ### Description Registers all logging levels within a specified `LevelGroup` in a single operation. This function simplifies the process of adding multiple log levels at once, which would otherwise require individual calls to `add_logging_level`. ### Usage ```python from mfd_common_libs import add_logging_group, LevelGroup # Register all levels for the 'TEST' group add_logging_group(LevelGroup.TEST) # Register all levels for the 'BL' group add_logging_group(LevelGroup.BL) # Register all levels for the 'MFD' group, including MODULE_DEBUG add_logging_group(LevelGroup.MFD) ``` ### Parameters - **level_group** (`LevelGroup`) - Required - The logging level group to register. ``` -------------------------------- ### Sign Git Commits Automatically Source: https://github.com/intel/mfd-common-libs/blob/main/CONTRIBUTING.md Configure your Git user name and email to automatically sign commits with the Developer Certificate of Origin. ```git git commit -s ``` -------------------------------- ### log_func_info Decorator Source: https://github.com/intel/mfd-common-libs/blob/main/README.md A decorator that logs the name and arguments of a decorated method using a provided logger. ```APIDOC ## log_func_info ### Description It's a decorator, which logs name and passed arguments to decorated method. Uses given logger ### Params * `logger` - object of Logger ### Usage ```python import logging from mfd_common_libs import log_func_info logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) @log_func_info(logger) def calling_someone(someone): pass calling_someone('Adam') ``` logs `MODULE_DEBUG:__main__:Calling func: calling_someone with arguments: ['Adam']` ``` -------------------------------- ### Trace Function Calls with log_func_info Decorator Source: https://context7.com/intel/mfd-common-libs/llms.txt The `log_func_info` decorator logs a function's name, positional, and keyword arguments at `MODULE_DEBUG` level. It requires a logger instance and automatically registers the `MODULE_DEBUG` level upon import. Use `functools.wraps` to preserve metadata. ```python import logging from mfd_common_libs import log_func_info, log_levels logging.basicConfig(level=log_levels.MODULE_DEBUG) logger = logging.getLogger(__name__) # --- Positional arguments --- @log_func_info(logger) def calling_someone(someone: str) -> None: print(f"Hello, {someone}!") calling_someone("Adam") # Log: MODULE_DEBUG:__main__:Calling func: calling_someone with arguments: ['Adam'] # Print: Hello, Adam! # --- Keyword arguments --- @log_func_info(logger) def connect(host: str, port: int = 22, username: str = "root") -> None: print(f"Connecting to {username}@{host}:{port}") connect(host="192.168.1.10", port=22, username="admin") # Log: MODULE_DEBUG:__main__:Calling func: connect with keyword arguments: {'host': '192.168.1.10', 'port': 22, 'username': 'admin'} # --- No arguments --- @log_func_info(logger) def calling() -> None: pass calling() # Log: MODULE_DEBUG:__main__:Calling func: calling # --- Mixed positional and keyword arguments --- @log_func_info(logger) def run_command(cmd: str, *, timeout: int = 30) -> str: return f"ran: {cmd}" run_command("uname -a", timeout=10) # Log: MODULE_DEBUG:__main__:Calling func: run_command with arguments: ['uname -a'] keyword arguments: {'timeout': 10} ``` -------------------------------- ### add_logging_level Source: https://context7.com/intel/mfd-common-libs/llms.txt Registers a named custom log level with Python's logging module, making it available for use with logger.log(). The function is idempotent. ```APIDOC ## add_logging_level ### Description Registers a custom log level name and its corresponding numeric value with Python's `logging` module. This function is idempotent, meaning it can be safely called multiple times with the same level name. ### Usage ```python import logging from mfd_common_libs import add_logging_level from mfd_common_libs import log_levels # Register individual custom levels add_logging_level("CMD", log_levels.CMD) # 12 add_logging_level("MODULE_DEBUG", log_levels.MODULE_DEBUG) # 13 add_logging_level("MFD_DEBUG", log_levels.MFD_DEBUG) # 14 logger = logging.getLogger(__name__) logging.basicConfig(level=log_levels.CMD) # show everything from CMD (12) up logger.log(level=log_levels.CMD, msg="ssh root@host 'uname -a'") # Output: CMD:__main__:ssh root@host 'uname -a' logger.log(level=log_levels.MODULE_DEBUG, msg="Entering retry block") # Output: MODULE_DEBUG:__main__:Entering retry block # Safe to call again — no-op if level_name already registered add_logging_level("CMD", log_levels.CMD) # silently ignored ``` ``` -------------------------------- ### add_logging_level Method Source: https://github.com/intel/mfd-common-libs/blob/main/README.md Adds a new logging level to the `logging` module. If the logging name already exists, the method does nothing. ```APIDOC ## add_logging_level ### Description Add a new logging level to the `logging` module. Does nothing if logging name is already declared. ### Signature `add_logging_level(level_name: str, level_value: int) -> None` ``` -------------------------------- ### DisableLogger Context Manager Source: https://github.com/intel/mfd-common-libs/blob/main/README.md A context manager to temporarily suppress log messages. It can suppress all messages by default or messages up to a specified level. ```APIDOC ## DisableLogger ### Description Context manager to temporarily suppress log messages. By default, suppresses all log messages from levels 0 - MODULE_DEBUG (inclusive). Can be parametrized by providing `level` argument. ### Usage ```python from mfd_common_libs import DisableLogger with DisableLogger(): # do something ``` ```python from mfd_common_libs import DisableLogger with DisableLogger(level=logging.INFO): # do something ``` ``` -------------------------------- ### DisableLogger Custom Level Suppression Source: https://context7.com/intel/mfd-common-libs/llms.txt Shows how to use DisableLogger to suppress log messages up to a specific level, such as logging.INFO. Messages at or above the specified level will be suppressed. ```python # Suppress up to and including INFO (level 20) with DisableLogger(level=logging.INFO): logger.info("Suppressed") logger.warning("WARNING is above INFO, so this still appears") ``` -------------------------------- ### DisableLogger Default Suppression Source: https://context7.com/intel/mfd-common-libs/llms.txt Demonstrates the default behavior of DisableLogger, which suppresses log messages up to and including the MODULE_DEBUG level (13). Logging is automatically restored upon exiting the 'with' block. ```python import logging from mfd_common_libs import DisableLogger from mfd_common_libs import log_levels logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) # Suppress everything up to MODULE_DEBUG (level 13) — the default with DisableLogger(): logger.debug("This debug message is suppressed") logger.log(log_levels.MODULE_DEBUG, "Also suppressed") logger.debug("Logging restored — this appears normally") ``` -------------------------------- ### add_logging_group Method Source: https://github.com/intel/mfd-common-libs/blob/main/README.md Adds all log levels associated with a given `LevelGroup` to the logging module. ```APIDOC ## add_logging_group ### Description Add all log levels related to the given group to the logging module. Basically, add all log levels which include LevelGroup substring. So for example `add_logging_group(LevelGroup.BL)` will add: * `log_levels.BL_STEP` * `log_levels.BL_INFO` * `log_levels.BL_DEBUG` ### Signature `add_logging_group(level_group: LevelGroup) -> None` ``` -------------------------------- ### DisableLogger Critical Level Suppression Source: https://context7.com/intel/mfd-common-libs/llms.txt Illustrates suppressing all log messages, including critical ones, by setting the level to logging.CRITICAL. This is useful for temporarily silencing all output during specific operations. ```python # Suppress everything (use logging.CRITICAL = 50) with DisableLogger(level=logging.CRITICAL): logger.critical("Even CRITICAL is suppressed here") logger.info("Back to normal after context exit") ``` -------------------------------- ### Define Log Level Group Enum Source: https://github.com/intel/mfd-common-libs/blob/main/README.md An enumeration class to define groups of log levels. This is used in conjunction with methods like 'add_logging_group' to manage logging configurations. ```python class LevelGroup(Enum): """Names of log levels' groups.""" BL = auto() MFD = auto() TEST = auto() ``` -------------------------------- ### DisableLogger Source: https://context7.com/intel/mfd-common-libs/llms.txt DisableLogger is a context manager that temporarily suppresses log records up to a specified level. Logging is restored upon exiting the 'with' block. ```APIDOC ## DisableLogger ### Description A context manager that temporarily disables log records up to and including a specified level. All logging is restored when the context is exited. ### Usage ```python import logging from mfd_common_libs import DisableLogger from mfd_common_libs import log_levels logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) # Suppress everything up to MODULE_DEBUG (level 13) — the default with DisableLogger(): logger.debug("This debug message is suppressed") logger.log(log_levels.MODULE_DEBUG, "Also suppressed") logger.debug("Logging restored — this appears normally") # Suppress up to and including INFO (level 20) with DisableLogger(level=logging.INFO): logger.info("Suppressed") logger.warning("WARNING is above INFO, so this still appears") # Suppress everything (use logging.CRITICAL = 50) with DisableLogger(level=logging.CRITICAL): logger.critical("Even CRITICAL is suppressed here") logger.info("Back to normal after context exit") ``` ``` -------------------------------- ### Suppress Log Messages with DisableLogger Source: https://github.com/intel/mfd-common-libs/blob/main/README.md Use this context manager to temporarily suppress log messages. By default, it suppresses messages from levels 0 to MODULE_DEBUG. You can specify a different level using the 'level' argument. ```python from mfd_common_libs import DisableLogger with DisableLogger(): # do something ``` ```python from mfd_common_libs import DisableLogger with DisableLogger(level=logging.INFO): # do something ``` -------------------------------- ### Git Commit Sign-off Line Source: https://github.com/intel/mfd-common-libs/blob/main/CONTRIBUTING.md The required sign-off line to be appended to every Git commit message, certifying the Developer's Certificate of Origin. ```git Signed-off-by: Joe Smith ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.