servermgrv2/app/Libraries/Log/Log.php
최준흠git config git config --helpgit config --global user.name 최준흠 b3659ee820 servermgrv2 init...
2023-07-22 23:19:44 +09:00

29 lines
695 B
PHP

<?php
namespace App\Libraries\Log;
class Log
{
private static $_logs = array();
private static $_dbInstance = null;
public function __construct()
{
}
final static public function add(string $level, string $content)
{
$content = date("H:i:s") . "-[{$level}]:{$content}";
if ($level !== "debug") {
array_push(self::$_logs, $content);
}
log_message($level, $content);
}
final static public function save(string $title, string $status = 'success')
{
if (self::$_dbInstance === null) {
self::$_dbInstance = new \App\Libraries\Log\DataBase();
}
// self::$_dbInstance->save($title, $status, self::$_logs);
self::$_logs = array();
}
}