<?php
/**
 * FleekDash Debug Helper Functions
 * Zero performance impact when debug is OFF
 */

if (!function_exists('fleekdash_log')) {
    /**
     * Log message to debug.log only if FleekDash debug is active
     * Zero performance impact when debug is OFF
     *
     * @param string $message Message to log
     * @param string $level Log level (INFO, WARN, ERROR, DEBUG)
     */
    function fleekdash_log(string $message, string $level = 'INFO'): void
    {
        if (class_exists('FleekDash\Core\DebugLogger')) {
            \FleekDash\Core\DebugLogger::log($message, $level);
        }
    }
}

if (!function_exists('fleekdash_log_info')) {
    /**
     * Log info message
     */
    function fleekdash_log_info(string $message): void
    {
        fleekdash_log($message, 'INFO');
    }
}

if (!function_exists('fleekdash_log_warn')) {
    /**
     * Log warning message
     */
    function fleekdash_log_warn(string $message): void
    {
        fleekdash_log($message, 'WARN');
    }
}

if (!function_exists('fleekdash_log_error')) {
    /**
     * Log error message
     */
    function fleekdash_log_error(string $message): void
    {
        fleekdash_log($message, 'ERROR');
    }
}

if (!function_exists('fleekdash_log_debug')) {
    /**
     * Log debug message
     */
    function fleekdash_log_debug(string $message): void
    {
        fleekdash_log($message, 'DEBUG');
    }
}

if (!function_exists('fleekdash_is_debug_logging_active')) {
    /**
     * Check if debug logging is active
     * Zero performance impact when debug is OFF
     *
     * @return bool
     */
    function fleekdash_is_debug_logging_active()
    {
        if (class_exists('FleekDash\Core\DebugLogger')) {
            return \FleekDash\Core\DebugLogger::isDebugLoggingActive();
        }
        return false;
    }
}
// Note: Closing PHP tag intentionally omitted to prevent whitespace output issues
