mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
修复 socketlog 的bug
This commit is contained in:
@@ -120,7 +120,7 @@ class Slog
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_error_handler([__CLASS__, 'error_handler']);
|
set_error_handler([__CLASS__, 'error_handler']);
|
||||||
register_shutdown_function([__CLASS__, 'fatalError']));
|
register_shutdown_function([__CLASS__, 'fatalError']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function error_handler($errno, $errstr, $errfile, $errline)
|
public static function error_handler($errno, $errstr, $errfile, $errline)
|
||||||
@@ -260,7 +260,7 @@ class Slog
|
|||||||
}
|
}
|
||||||
|
|
||||||
//记录日志
|
//记录日志
|
||||||
public function record($type, $msg = '', $css = '')
|
public static function record($type, $msg = '', $css = '')
|
||||||
{
|
{
|
||||||
if (!self::check()) {
|
if (!self::check()) {
|
||||||
return;
|
return;
|
||||||
@@ -373,7 +373,7 @@ class Slog
|
|||||||
{
|
{
|
||||||
if (in_array($method, self::$log_types)) {
|
if (in_array($method, self::$log_types)) {
|
||||||
array_unshift($args, $method);
|
array_unshift($args, $method);
|
||||||
return call_user_func_array(self::record, $args);
|
return call_user_func_array(['\org\Slog','record'], $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class App
|
|||||||
}
|
}
|
||||||
//判断,如果启动SocketLog调试, 进行SocketLog配置
|
//判断,如果启动SocketLog调试, 进行SocketLog配置
|
||||||
if ($config['slog']['enable']) {
|
if ($config['slog']['enable']) {
|
||||||
|
define('SLOG_ENABLE',true);
|
||||||
\org\Slog::config($config['slog']);
|
\org\Slog::config($config['slog']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ class Error
|
|||||||
{
|
{
|
||||||
// 记录日志
|
// 记录日志
|
||||||
Log::save();
|
Log::save();
|
||||||
|
if(defined('SLOG_ENABLE') && SLOG_ENABLE) {
|
||||||
\org\Slog::sendLog();
|
\org\Slog::sendLog();
|
||||||
|
}
|
||||||
if ($e = error_get_last()) {
|
if ($e = error_get_last()) {
|
||||||
switch ($e['type']) {
|
switch ($e['type']) {
|
||||||
case E_ERROR:
|
case E_ERROR:
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ return [
|
|||||||
'think\Url' => CORE_PATH . 'url' . EXT,
|
'think\Url' => CORE_PATH . 'url' . EXT,
|
||||||
'think\Debug' => CORE_PATH . 'debug' . EXT,
|
'think\Debug' => CORE_PATH . 'debug' . EXT,
|
||||||
'think\Input' => CORE_PATH . 'input' . EXT,
|
'think\Input' => CORE_PATH . 'input' . EXT,
|
||||||
'think\Lang' => CORE_PATH . 'lang' . EXT,
|
'think\Lang' => CORE_PATH . 'lang' . EXT
|
||||||
'think\Slog' => CORE_PATH . 'slog' . EXT
|
|
||||||
],
|
],
|
||||||
|
|
||||||
'init' => [],
|
'init' => [],
|
||||||
|
|||||||
Reference in New Issue
Block a user