from .dfx_config_manager import get_config_manager, reload_config as reload_dfx_config
_DEBUG_ENABLED = get_config_manager().build_dfx_debug_enable
def _load_debug_config():
"""Load debug configuration"""
global _DEBUG_ENABLED
_DEBUG_ENABLED = get_config_manager().build_dfx_debug_enable
def dfx_info(*args, **kwargs):
"""Print information based on configuration settings"""
if _DEBUG_ENABLED:
print('[DFX INFO]', *args, **kwargs)
def dfx_error(*args, **kwargs):
"""Print error information based on configuration settings"""
if _DEBUG_ENABLED:
print("[DFX ERROR]", *args, **kwargs)
def dfx_debug(*args, **kwargs):
"""Print debug information only in debug mode with [DEBUG] prefix"""
if _DEBUG_ENABLED:
print('[DFX DEBUG]', *args, **kwargs)
def is_debug_enabled():
"""Check if debug mode is enabled"""
return _DEBUG_ENABLED
def reload_config():
"""Reload configuration"""
reload_dfx_config()
_load_debug_config()