<?php

namespace FleekDash\Traits;

if (!\function_exists('fleekdash_log_debug')) {
    require_once FLEEKDASH_PLUGIN_DIR . 'includes/Core/debug-helpers.php';
}

trait BaseModuleLoggingTrait
{
    abstract protected function getName(): string;

    /**
     * Log an error for this module.
     */
    protected function log_error(string $message): void // NOSONAR php:S100 - backward-compatible internal API
    {
        fleekdash_log_error("FleekDash Module Error [{$this->getName()}]: {$message}");
    }

    /**
     * Log an info line for this module.
     */
    protected function log_info(string $message): void // NOSONAR php:S100 - backward-compatible internal API
    {
        fleekdash_log_info("FleekDash Module Info [{$this->getName()}]: {$message}");
    }
}
