內容簡介
這個外掛可以將斷點信息記錄到文件中。
要檢查日誌,請 SSH 登錄到服務器,在終端運行 tail -f /your_wordpress_path/wp-content/debug.log 查看輸出。
API
在插件/主題代碼中,使用 defined( 'debug' ) && debug( '要記錄的內容' ); 進行日誌記錄。
要僅在高級調試級別下進行日誌記錄,使用 defined( 'debug' ) && debug2( '要記錄的內容' );。
要在回溯深度為 4 的情況下進行日誌記錄,使用 defined( 'debug' ) && debug( '要記錄的內容', 4 );。
要追加一個變量(通常是數組)進行日誌記錄,使用 defined( 'debug' ) && debug( '要記錄的內容', $var_to_check );。
外掛標籤
開發者團隊
原文外掛簡介
This plugin can log the breakpoints into the file.
To check the log, ssh to server, run tail -f /your_wordpress_path/wp-content/debug.log to watch the output.
API
To log, use defined( 'debug' ) && debug( 'your content to log' ); in your plugin/theme code.
To log only in advanced debug level, use defined( 'debug' ) && debug2( 'your content to log' );.
To log with backtrace depth = 4, use defined( 'debug' ) && debug( 'your content to log', 4 );.
To append one variable (usually an array), use defined( 'debug' ) && debug( 'your content to log', $var_to_check );.
