<?php

namespace apexl\Io\services;

use apexl\ClassEngine\EngineSingleton;
use apexl\Vault\Vault;

class Logger extends EngineSingleton
{
    public static function log($type, $data)
    {
        $vault = Vault::getInstance();
        $vault->setDefaultVault('default');
        Database::persistRawBatch([['timestamp' => date('Y-m-d H:i:s'), 'log_type' => $type, 'log_data' => json_encode($data)]], 'log_generic');
    }
}
