1
头图

v4.8.1 The version mainly optimizes the code of the admin server without downward incompatible changes.

Support to ignore the specified error code log

In this version, the error log corresponding to the specified error code can be ignored, for example:

const LOG_FILE = __DIR__ . '/log';
if (is_file(LOG_FILE)) {
    unlink(LOG_FILE);
}

const ERRNO_1 = 888888;
const ERRNO_2 = 999999;

swoole_async_set(['log_file' => LOG_FILE]);
swoole_error_log(SWOOLE_LOG_NOTICE, 'swoole_error_log msg');
swoole_error_log_ex(SWOOLE_LOG_NOTICE, ERRNO_1, 'swoole_error_log_ex msg');

// 忽略错误码为ERRNO_2的日志
swoole_ignore_error(ERRNO_2);
swoole_error_log_ex(SWOOLE_LOG_NOTICE, ERRNO_2, 'swoole_error_log_ex ERRNO_2 msg');

echo file_get_contents(LOG_FILE);

Ignore the log with the error code ERRNO_2 , so there is no information about swoole_error_log_ex ERRNO_2 msg

[2021-10-28 10:34:01 @23580.0]  NOTICE  swoole_error_log msg
[2021-10-28 10:34:01 @23580.0]  NOTICE  zif_swoole_error_log_ex() (ERRNO 888888): swoole_error_log_ex msg

At the same time, you can also use the swoole_error_log_ex function to write the log of the specified error level and error code to the log file.

Admin Server

A lot of code admin_server has been optimized in this version:

  • Migrate the admin api in ext-swoole_plus to ext-swoole, you can use all the functions of Swoole Dashboard

  • Supports concurrent requests for multiple targets and concurrent requests for multiple APIs. For details, please refer to RFC #78
  • Added the get_composer_packages command to view the composer dependency information in the project

  • Support to obtain method information in a certain class
  • Support to obtain information about interface

After you can update the swoole version, go to Swoole Dashboard to experience it.

Update log

The following is the complete update log:

New API

  • Added swoole_error_log_ex() and swoole_ignore_error() functions (#4440) (@matyhtf)

Enhance

  • Migrate admin api in ext-swoole_plus to ext-swoole (#4441) (@matyhtf)
  • admin server adds get_composer_packages command (swoole/library@07763f46) (swoole/library@8805dc05) (swoole/library@175f1797) (@sy-records) (@yunbaoi)
  • Added the POST method request limit for write operations (swoole/library@ac16927c) (@yunbaoi)
  • admin server supports obtaining class method information (swoole/library@690a1952) (@djw1028769140) (@sy-records)
  • Optimize the admin server code (swoole/library#128) (swoole/library#131) (@sy-records)
  • admin server supports concurrent requests for multiple targets and concurrent requests for multiple APIs (swoole/library#124) (@sy-records)
  • admin server supports obtaining interface information (swoole/library#130) (@sy-records)
  • SWOOLE_HOOK_CURL supports CURLOPT_HTTPPROXYTUNNEL (swoole/library#126) (@sy-records)

repair

  • The join method prohibits concurrent calls to the same coroutine (#4442) (@matyhtf)
  • Fix the problem of accidental release of Table atomic lock (#4446) (@Txhua) (@matyhtf)
  • Fix missing helper options (swoole/library#123) (@sy-records)
  • Fix get_static_property_value command parameter error (swoole/library#129) (@sy-records)


沈唁
1.9k 声望1.2k 粉丝