[wordpress插件] Debugger调试器

wordpress 插件 文章 2020-04-14 08:50 482 0 全屏看文

AI助手支持GPT4.0

评分
90
描述

You can use this plugin to manually log data or to capture logging on WordPress actions.

您可以使用此插件手动记录数据或捕获有关WordPress操作的记录。

You can capture load time, memory, backrace, data dumps, urls, and server IPs.

您可以捕获加载时间,内存,后退,数据转储,URL和服务器IP。

This is designed to either be managed using wp-config.php and logging OR using the admin and debugbar plugin ( https://wordpress.org/extend/plugins/debug-bar/ ).

设计为使用wp-config.php进行管理并记录日志,或者使用admin和debugbar插件(https://wordpress.org/extend/plugins/debug-bar/)进行管理。

Most of the following documentation applies equally to the settings panel or the wp-config.php vars.

以下大多数文档同样适用于设置面板或wp-config.php vars。

Either one works fine.

两种都可以。

The only exception is the DEBUG_LOG configuration which is only supported as a wp-config var.

唯一的例外是DEBUG_LOG配置,仅将其作为wp-config变量支持。

Firstly, you can manually log things using the following function:

首先,您可以使用以下功能手动记录事物:

do_action( 'log', $message, $group, $data );

  do_action('log',$ message,$ group,$ data);

The $group allows you to selectively output logging based on groups of log messages.

$ group允许您根据日志消息组有选择地输出日志。

The $message is the string you want to see in the log.

$ message是您要在日志中看到的字符串。

$data is an optional parameter for the data that you want to display in the log (objects, arrays, or any other sort of data really).

$ data是要在日志中显示的数据(对象,数组或其他任何类型的数据)的可选参数。

To render messages to the log, you must configure wp-config.php as follows:

要将消息呈现到日志,必须按以下方式配置wp-config.php:

Run debug on only these groups.

仅在这些组上运行调试。

Use ‘ALL’ to debug everything.

使用“全部”调试所有内容。

The group ‘ACTIONS’ is reserved for WordPress actions.

“ ACTIONS”组保留用于WordPress操作。

define( 'DEBUG_GROUPS', 'ACTIONS,default,myspecialgroup' );

  define('DEBUG_GROUPS','ACTIONS,default,myspecialgroup');

Display these outputs in the log for each log message.

在每个日志消息的日志中显示这些输出。

define( 'DEBUG_PARAMS', 'time,timedelta,memory,memorydelta,data,backtrace,url,server' );

  define('DEBUG_PARAMS','time,timedelta,memory,memorydelta,data,backtrace,url,server');

WordPress actions that you wish to log.

您希望记录的WordPress操作。

define( 'DEBUG_ACTIONS', 'wp_head,switch_theme,wp_footer' );

  define('DEBUG_ACTIONS','wp_head,switch_theme,wp_footer');

Optional restriction by URL (useful on MU installs).

URL的可选限制(在MU安装中很有用)。

define( 'DEBUG_URLS', 'myurl.com' );

  define('DEBUG_URLS','myurl.com');

Minimum time in milliseconds required to register a log entry as being slow.

将日志条目注册为慢速所需的最短时间(以毫秒为单位)。

Default 0 for no minumum.

默认值0,表示最小值。

define( 'DEBUG_MIN_TIME', 500 );

  define('DEBUG_MIN_TIME',500);

Minimum memory in killobytes required to register a log entry as being heavy.

注册沉重的日志条目所需的最小内存(以Killobytes为单位)。

Default 0 for no minumum.

默认值0,表示最小值。

define( 'DEBUG_MIN_MEM', 1024 );

  define('DEBUG_MIN_MEM',1024);

Path to log file or set to TRUE to use php error log.

日志文件的路径或设置为TRUE以使用php错误日志。

Default FALSE for no logging.

默认为FALSE(不记录)。

define( 'DEBUG_LOG', '/path/to/writable/log/file' );

  define('DEBUG_LOG','/ path / to / writable / log / file');

or

define( 'DEBUG_LOG', TRUE );

  define('DEBUG_LOG',TRUE);

Todo

Todo

    • Add variable for sample rate so that this could run randomly on production installs
    • 添加采样率变量,以便可以在生产安装中随机运行

    • Admin panel per site
    • 每个站点的管理面板

    • Admin panel globally
    • 全局管理面板

    • WordPress error logging
    • WordPress错误记录

    • Mysql query logging
    • MySQL查询日志记录

    • WP_Error integration
    • WP_Error集成

    • Alerts ex: if this takes more than this much memory then log it…
    • 警报,例如:如果占用的内存超过此内存,则将其记录下来……

下载地址
https://downloads.wordpress.org/plugin/debugger.1.4.zip
-EOF-

AI助手支持GPT4.0