31 lines
666 B
PHP
31 lines
666 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 InfoLog($title, $params = []): void
|
|
{
|
|
Log::error(self::getTitle($title,'info:'), $params);
|
|
}
|
|
|
|
static function getTitle($title,$prefix=''): string
|
|
{
|
|
return $title.' '.$prefix;
|
|
}
|
|
|
|
|
|
}
|