<?php
namespace Gestoreasy\Core\Fiscal\Logging;

use Gestoreasy\Core\Audit\AuditLogger;

class FiscalLogger {
    public static function log(string $category, string $action, array $data = []): void {
        try {
            AuditLogger::logGeneric('fiscal.' . $category, $action, $data);
        } catch (\Throwable $e) {
            // Tolerate logging failures silently to not break main flow
        }
    }
    public static function read(string $category, array $data = []): void {
        try { AuditLogger::logRead('fiscal.' . $category, null, $data); } catch (\Throwable $e) {}
    }
    public static function write(string $category, array $data = []): void {
        try { AuditLogger::logWrite('fiscal.' . $category, null, $data); } catch (\Throwable $e) {}
    }
    public static function error(string $category, string $message, array $data = []): void {
        try { AuditLogger::logGeneric('fiscal.' . $category, 'error', ['message' => $message] + $data); } catch (\Throwable $e) {}
    }
}