Compare commits

...

4 Commits

Author SHA1 Message Date
as2252258 73cb94f657 改名 2021-07-09 14:38:49 +08:00
as2252258 b3ea8978b1 改名 2021-07-09 14:24:23 +08:00
as2252258 008a0914eb 改名 2021-07-09 13:55:52 +08:00
as2252258 01f8e16b38 改名 2021-07-09 13:41:06 +08:00
2 changed files with 646 additions and 648 deletions
File diff suppressed because it is too large Load Diff
+23 -23
View File
@@ -39,7 +39,7 @@ class Logger extends Component
/**
* @param $message
* @param mixed $message
* @param string $method
* @param null $file
* @throws Exception
@@ -51,18 +51,18 @@ class Logger extends Component
/**
* @param $message
* @param mixed $message
* @param string $method
* @throws Exception
*/
public function trance($message, $method = 'app')
public function trance(mixed $message, string $method = 'app')
{
$this->writer($message, $method);
}
/**
* @param $message
* @param mixed $message
* @param string $method
* @param null $file
* @throws Exception
@@ -72,13 +72,13 @@ class Logger extends Component
$this->writer($message, $method);
}
/**
* @param $message
* @param string $method
* @param null $file
* @throws Exception
*/
public function success(mixed $message, $method = 'app', $file = null)
/**
* @param mixed $message
* @param string $method
* @param null $file
* @throws Exception
*/
public function success(mixed $message, string $method = 'app', $file = null)
{
$this->writer($message, $method);
}
@@ -89,7 +89,7 @@ class Logger extends Component
* @return string
* @throws Exception
*/
private function writer($message, $method = 'app'): string
private function writer($message, string $method = 'app'): string
{
$this->print_r($message, $method);
if ($message instanceof Throwable) {
@@ -114,10 +114,10 @@ class Logger extends Component
/**
* @param $message
* @param $method
* @param string $method
* @throws Exception
*/
public function print_r($message, $method = '')
public function print_r($message, string $method = '')
{
$debug = Config::get('debug', ['enable' => false]);
if ((bool)$debug['enable'] === true) {
@@ -145,7 +145,7 @@ class Logger extends Component
* @param string $application
* @return mixed
*/
public function getLastError($application = 'app'): mixed
public function getLastError(string $application = 'app'): mixed
{
$filetype = [];
foreach ($this->logs as $key => $val) {
@@ -160,15 +160,15 @@ class Logger extends Component
return end($filetype);
}
/**
* @param $messages
* @param string $method
* @throws
*/
public function write(string $messages, $method = 'app')
/**
* @param string $messages
* @param string $method
* @throws Exception
*/
public function write(string $messages, string $method = 'app')
{
if (empty($messages)) {
return;
return;
if (empty($messages)) {
}
$fileName = 'server-' . date('Y-m-d') . '.log';