
內容簡介
此外掛可在儀表板上檢視日誌檔案(debug.log)並編輯來自 wp-config.php 的除錯常數,它還提供了其他針對除錯功能的特色。
使用/SplFileObject類別載入日誌檔案,它會使用分頁方式只載入某些行,以優化記憶體使用量,並在儀表板上(工具 > 日誌檔案)顯示日誌檔案。
啟用此外掛時,它會嘗試將WP_DEBUG和WP_DEBUG_LOG設定為true,並禁用WP_DEBUG_DISPLAY,在此外掛取消啟用時,則嘗試做相反的設定。
您可以在設定中更改此行為。
WP Config 常數
使用wp-cli/wp-config-transformer庫編輯wp-config.php,以下是編輯的常數:
WP_DEBUG
WP_DEBUG_LOG
WP_DEBUG_DISPLAY
SCRIPT_DEBUG
SAVEQUERIES
產生簡化的日誌檔案
可以從原始日誌檔案產生簡化的副本日誌檔案(debug-reduced.log),只載入其中的最後幾行(類似於Linux的tail命令)。
外掛標籤
開發者團隊
原文外掛簡介
This plugin allows viewing the log file (debug.log) on the Dashboard and editing the debugging constants from wp-config.php. It also provides other debugging oriented features.
The log file is loaded on the Dashboard (Tools > Log File) using the /SplFileObject class, optimized for memory usage, and it will use a pagination in order to load only some lines from it.
The plugin will try to enable WP_DEBUG and WP_DEBUG_LOG to true and disable WP_DEBUG_DISPLAY on its first run and will try to do the opposite when it’s deactivated.
You can change this behaviour if you want in the settings.
WP Config Constants
The wp-config.php is being edited using wp-cli/wp-config-transformer library, and these are the edited constants:
WP_DEBUG
WP_DEBUG_LOG
WP_DEBUG_DISPLAY
SCRIPT_DEBUG
SAVEQUERIES
Generate a reduced log file
It’s possible to generate a reduced duplicate log file (debug-reduced.log) from the original one loading only the last lines from it (something like the tail command from Linux).
