Static method to get value from any dictionary using dot notation
(data: dict[str, Any], path: str, default: Any = None)
| 305 | |
| 306 | @staticmethod |
| 307 | def get_path_from_dict(data: dict[str, Any], path: str, default: Any = None) -> Any: |
| 308 | """Static method to get value from any dictionary using dot notation""" |
| 309 | current = data |
| 310 | for key in path.split("."): |
| 311 | if isinstance(current, dict) and key in current: |
| 312 | current = current[key] |
| 313 | else: |
| 314 | return default |
| 315 | return current |
| 316 | |
| 317 | |
| 318 | # Global variable to store the directory to search for logs |