<?php

declare(strict_types=1);

namespace App\Core;

final class Logger
{
    public static function info(string $message): void
    {
        self::write('INFO', $message);
    }

    public static function error(string $message): void
    {
        self::write('ERROR', $message);
    }

    private static function write(string $level, string $message): void
    {
        $file = STORAGE_PATH . '/logs/darlink.log';
        $line = '[' . date('Y-m-d H:i:s') . "] {$level}: {$message}" . PHP_EOL;
        file_put_contents($file, $line, FILE_APPEND);
    }
}
