# MIT License# Copyright (c) 2025 aeeeeeepimportloggingfromtypesimportModuleTypefromdataclassesimportdataclassfromtypingimportOptional,Union,Listfrom.wrappersimportABCWrapper
[docs]@dataclass(frozen=True)classObjWatchConfig:""" Configuration parameters for ObjWatch. Args: targets (List[Union[str, ModuleType]]): Files or modules to monitor. exclude_targets (Optional[List[Union[str, ModuleType]]]): Files or modules to exclude from monitoring. framework (Optional[str]): The multi-process framework module to use. indexes (Optional[List[int]]): The indexes to track in a multi-process environment. output (Optional[str]): Path to a file for writing logs. output_xml (Optional[str]): Path to the XML file for writing structured logs. level (int): Logging level (e.g., logging.DEBUG, logging.INFO). simple (bool): Enable simple logging mode with the format "DEBUG: {msg}". wrapper (Optional[ABCWrapper]): Custom wrapper to extend tracing and logging functionality. with_locals (bool): Enable tracing and logging of local variables within functions. with_globals (bool): Enable tracing and logging of global variables across function calls. """targets:List[Union[str,ModuleType]]exclude_targets:Optional[List[Union[str,ModuleType]]]=Noneframework:Optional[str]=Noneindexes:Optional[List[int]]=Noneoutput:Optional[str]=Noneoutput_xml:Optional[str]=Nonelevel:int=logging.DEBUGsimple:bool=Falsewrapper:Optional[ABCWrapper]=Nonewith_locals:bool=Falsewith_globals:bool=False
[docs]def__post_init__(self)->None:""" Post-initialization configuration validation """ifnotself.targets:raiseValueError("At least one monitoring target must be specified")ifself.level=="force"andself.outputisnotNone:raiseValueError("output cannot be specified when level is 'force'")