Skip to main content

Module

Decorators for conditionally enabling/disabling Permitech telemetry. These decorators check the PERMITECH_LOGGING_DISABLED environment variable and skip execution of telemetry operations when disabled.

permitech_logging_enabled

Check if Permitech logging/telemetry is enabled. Returns
  • bool: True if logging is enabled (default), False if PERMITECH_LOGGING_DISABLED is set.

nop_async

Decorator that skips execution of async functions when Permitech logging is disabled. When PERMITECH_LOGGING_DISABLED is set to “true”, “1”, or “t”, the decorated function will not execute and will return None instead. Arguments
  • f (Callable): The asynchronous function to wrap.
Returns
  • Callable: A wrapped async function that checks the logging toggle before execution.

nop_sync

Decorator that skips execution of sync functions when Permitech logging is disabled. When PERMITECH_LOGGING_DISABLED is set to “true”, “1”, or “t”, the decorated function will not execute and will return None instead. Arguments
  • f (Callable): The synchronous function to wrap.
Returns
  • Callable: A wrapped function that checks the logging toggle before execution.