<?php
namespace App\Core;

class Logger
{
    public static function error($message)
    {
        $file = BASE_PATH . '/storage/logs/app_error.log';

        if (!file_exists(dirname($file))) {
            mkdir(dirname($file), 0775, true);
        }

        file_put_contents(
            $file,
            "[" . date('Y-m-d H:i:s') . "] " . $message . PHP_EOL,
            FILE_APPEND
        );
    }
}
