[WordPress] 外掛分享: DoDebug

首頁外掛目錄 › DoDebug
全新外掛
安裝啟用
尚無評分
2005 天前
最後更新
問題解決
WordPress 4.0+ v1.1 上架:2020-01-21

內容簡介

這個外掛可以將斷點信息記錄到文件中。

要檢查日誌,請 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 );。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「DoDebug」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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 );.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon