前言介紹
- 這款 WordPress 外掛「Bang System Logging」是 2013-08-29 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2013-08-30,距離現在已有 4265 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
內容簡介
啟用 WordPress 插件和主題開發的系統記錄。這可以讓您更容易知道您的代碼正在做什麼。
特點包括:
記錄到系統日誌或文件
輕鬆添加或嵌入日誌消息中的任何值
顯示不同類型的值的不同顏色,包括字符串、數字、數組、對象、空值等
從對象數組中提取值
可選地排除 AJAX、JavaScript、CSS 和任何其他 URL 模式
攔截 PHP 錯誤和登錄嚴格警告
測量兩點之間的記憶體使用量,或各部分代碼所花費的時間
易於關閉以使用於生產環境
如何使用
使用它就像在模板或插件中調用 'log' 操作一樣簡單。
這將在系統日誌中產生一行:
Jun 4 11:23:08 myserver php/mysite.com[1553]: b8e mysite.com/path-to-page: 一些日誌消息
包括:
Jun 4 11:23:08 - 日誌消息的日期和時間
myserver - 此計算機的名稱
php - 產生消息的程序
mysite.com - 網站的域名
1553 - 正在運行的 PHP 過程的進程 ID
b8e - 标识每个页面请求的随机三位代码
mysite.com/path-to-page - 請求的 URL
一些日誌消息 - 您的消息
有關更詳細的說明,請參見“如何使用”標籤頁。
原文外掛簡介
Enable system logging for WordPress plugin and theme development. This can make it easier to know what your code is doing.
Features include:
Log to the system log or to a file
Easily append or embed any value in log messages
Coloured logs indicating strings, numbers, arrays, objects, null values etc.
Extract values from arrays of objects
Optionally exclude AJAX, Javascripts, CSS and any other pattern of URLs.
Intercept PHP errors and log strict warnings
Measure memory usage between two points, or the time taken by various parts of your code
Easy to switch off for production sites
How to use
Using it is as simple as calling the 'log' action in your templates or plugin.
This will produce a line in your system log:
Jun 4 11:23:08 myserver php/mysite.com[1553]: b8e mysite.com/path-to-page: Some log message
This includes:
Jun 4 11:23:08 – The date and time of the log message
myserver – The name of this computer
php – The program that produced the message
mysite.com – The domain name of the site
1553 – The process ID of the running PHP process
b8e – A random 3-digit code identifying each page request
mysite.com/path-to-page – The URL of the request
Some log message – Your message
For more detailed instructions, see the How to use tab.
How to use
To log a message, use the 'log' action in your templates or plugins:
This will output the log message:
Some log message
Embedding values
If you include extra parameters, they’ll be added at the end of the log message:
This will produce the log message:
A number and a string: 17, foo
The value will be formatted correctly depending on its type: integers, strings, arrays, objects, booleans etc.
You don’t need to check if values are null or empty, they’ll still be output safely.
If you put the code %s into your log message, then one of the arguments will be dropped into the message:
This will produce the log message:
I have 4 numbers: [9, 16, 307, 1]
Selecting fields
Logging a complete object – such as a WordPress post – can be very large, and sometimes it’s only one or two fields you need.
If you put a string starting with an exclamation point "!" followed by a list of field names, they will be selected from the following object.
The following will only show the ID and post_title fields of the post:
This will produce the log message:
Loaded the post: {ID: 1932, post_title: Test page}
If you do this with an array of objects, those fields will be selected from each of them. The following will output a list of post IDs:
This will produce the log message:
Loaded 3 posts: [1932, 1594, 1103]
Coloured logs
If you have coloured logging switched on, values will appear in different colours to indicate their type.
This can make for quicker scanning of log files.
To enable coloured logs, tick the Coloured logs checkbox on the settings page.
Then use the log.sh script, included with this plugin, to decode and display the coloured log files.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Bang System Logging」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WP Crontrol 》WP Crontrol 可以讓您查看和控制 WP-Cron 系統中正在發生的事件。從管理界面,您可以:, , 查看所有的 Cron 事件以及它們的參數、循環間隔時間、回撥函數以及...。
Query Monitor – The developer tools panel for WordPress 》ministrator user). This cookie can be set by defining QM_AUTH_KEY in your wp-config.php file., To learn more about how to use Query Monitor, please...。
P3 (Plugin Performance Profiler) 》這個外掛程式可以創建您 WordPress 網站的外掛程式效能概況,並且藉由測量這些外掛對網站載入時間的影響。通常WordPress網站由於過多或配置不佳的外掛程式而...。
Debug Bar 》在管理列上新增一個除錯選單,顯示查詢、快取及其他有用的除錯資訊。, 開發者必備的外掛!, 當啟用WP_DEBUG時,也會追蹤 PHP 的警告和注意事項,使它們更容易...。
WP Debugging 》此外掛在啟用時會在 wp-config.php 中設定以下偵錯常數,並在停用時移除它們。任何錯誤都會導致拋出 PHP Exception。偵錯常數請參考 WordPress 的「Debugging...。
My WP Customize Admin/Frontend 》這個外掛讓管理者和前端使用者都能輕鬆地進行自訂設定。許多自訂篩選器和操作,還包含開發者工具。, 示範網站在這裡:https://tastewp.com/new/?pre-installe...。
reBusted! 》這個外掛可以免去你問「你有清空快取嗎?」的問題。, 這是根據原本由 Paul Clark 開發的外掛更新,以符合今天的 WordPress 和 PHP。, 功能, , 在線上網站上安...。
Debug Log Manager 》Debug Log Manager 可以讓您:, , 單擊啟用 WP_DEBUG 以記錄 PHP、數據庫和 JavaScript 錯誤,不需要手動編輯 wp-config.php 文件,完成後再禁用。 , 在自訂...。
Code Profiler – WordPress Performance Profiling and Debugging Made Easy 》一個可以測量 WordPress 外掛與佈景主題效能的分析工具。, Code Profiler 可以協助您在 PHP 層面上測量您的外掛與佈景主題的效能,並快速找到任何潛在的 Word...。
Plugin Detective – Troubleshooting Conflicts 》Plugin Detective 可以幫助您快速且輕鬆地排除網站上的問題,並找出問題的原因。一旦找到罪犯,您可以快速停用有問題的外掛程式。甚至當您的網站出現白屏、致...。
Dashboard Widgets Suite 》插件名稱:Dashboard Widgets Suite(控制面板小工具套裝), , 該外掛提供 1 個插件與 9 個小工具,可簡化您的工作流程並提高工作效率。該套裝小工具包括以下...。
which template file 》想知道 WordPress 在前台顯示頁面時使用哪個模板嗎?, 這個外掛可以幫您達成這個目的。您可以在免費的模擬網站上嘗試使用:點此連結 => https://tastewp.c...。
Debug This 》Debug This是由友好Macho Themes團隊打造、維護和運營的獨立外掛程式。, 對於管理員、開發人員和支援人員,Debug This提供了大量的有關WordPress安裝的信息,...。
Debug Log – Manager Tool 》這是一個簡單的除錯日誌外掛程式,您可以在儀表板中檢查除錯日誌。透過一個點擊,您可以啟用或停用除錯功能(例如 ‘ WP_DEBUG’、‘WP_DEBUG...。
Debug 》Debug 可以透過編輯 wp-config.php 檔案,幫助您在 WordPress 網站中找到錯誤。您可以使用 Debug 外掛啟用錯誤報告功能,在 WordPress CMS/網站上啟用任何運...。