Get usage tracking enabled setting from configuration. Args: config: Configuration dictionary Returns: True if usage tracking is enabled (default), False if disabled
(config: dict)
| 310 | |
| 311 | |
| 312 | def get_usage_tracking_enabled(config: dict) -> bool: |
| 313 | """Get usage tracking enabled setting from configuration. |
| 314 | |
| 315 | Args: |
| 316 | config: Configuration dictionary |
| 317 | |
| 318 | Returns: |
| 319 | True if usage tracking is enabled (default), False if disabled |
| 320 | """ |
| 321 | config_path = ["app", "usage_tracking", "enabled"] |
| 322 | if not traverse_config_path(config=config, config_path=config_path): |
| 323 | return True # Default to enabled if not configured |
| 324 | |
| 325 | value = get_config_value(config=config, config_path=config_path) |
| 326 | if isinstance(value, bool): |
| 327 | return value |
| 328 | |
| 329 | # Handle string values for backwards compatibility |
| 330 | if isinstance(value, str): |
| 331 | return value.lower() not in ("false", "no", "0", "disabled", "off") |
| 332 | |
| 333 | # Default to enabled for any other type |
| 334 | return True |
| 335 | |
| 336 | |
| 337 | # ============================================================================= |
no test coverage detected