This commit is contained in:
2021-07-09 14:24:23 +08:00
parent 008a0914eb
commit b3ea8978b1
+9 -11
View File
@@ -39,7 +39,7 @@ class Logger extends Component
/** /**
* @param $message * @param mixed $message
* @param string $method * @param string $method
* @param null $file * @param null $file
* @throws Exception * @throws Exception
@@ -51,18 +51,18 @@ class Logger extends Component
/** /**
* @param $message * @param mixed $message
* @param string $method * @param string $method
* @throws Exception * @throws Exception
*/ */
public function trance($message, $method = 'app') public function trance(mixed $message, string $method = 'app')
{ {
$this->writer($message, $method); $this->writer($message, $method);
} }
/** /**
* @param $message * @param mixed $message
* @param string $method * @param string $method
* @param null $file * @param null $file
* @throws Exception * @throws Exception
@@ -73,12 +73,12 @@ class Logger extends Component
} }
/** /**
* @param $message * @param mixed $message
* @param string $method * @param string $method
* @param null $file * @param null $file
* @throws Exception * @throws Exception
*/ */
public function success(mixed $message, $method = 'app', $file = null) public function success(mixed $message, string $method = 'app', $file = null)
{ {
$this->writer($message, $method); $this->writer($message, $method);
} }
@@ -89,9 +89,8 @@ class Logger extends Component
* @return string * @return string
* @throws Exception * @throws Exception
*/ */
private function writer($message, $method = 'app'): string private function writer($message, string $method = 'app'): string
{ {
return '';
$this->print_r($message, $method); $this->print_r($message, $method);
if ($message instanceof Throwable) { if ($message instanceof Throwable) {
$message = $message->getMessage(); $message = $message->getMessage();
@@ -115,10 +114,10 @@ class Logger extends Component
/** /**
* @param $message * @param $message
* @param $method * @param string $method
* @throws Exception * @throws Exception
*/ */
public function print_r($message, $method = '') public function print_r($message, string $method = '')
{ {
$debug = Config::get('debug', ['enable' => false]); $debug = Config::get('debug', ['enable' => false]);
if ((bool)$debug['enable'] === true) { if ((bool)$debug['enable'] === true) {
@@ -168,7 +167,6 @@ class Logger extends Component
*/ */
public function write(string $messages, string $method = 'app') public function write(string $messages, string $method = 'app')
{ {
return;
if (empty($messages)) { if (empty($messages)) {
return; return;
} }