Files
cycle_api/app/Tools/Logs.php
2024-03-11 02:21:52 +08:00

26 lines
536 B
PHP

<?php
namespace App\Tools;
use Illuminate\Support\Facades\Log;
class Logs
{
static function ErrLog($title, \Exception $e, $params = []): void
{
Log::error(self::getTitle($title,'error:'), ['message' => $e->getMessage(), 'trace' => $e->getTrace(), 'params' => $params]);
}
static function SuccLog($title, $params = []): void
{
Log::error(self::getTitle($title,'success:'), $params);
}
static function getTitle($title,$prefix=''): string
{
return $title.' '.$prefix;
}
}