內容簡介
這個外掛提供了一個簡單的 API,用於存儲雜項日誌條目和管理區域中它們的概述(如果在多站點上啟用,則是網路管理區域)。
為私人使用而開發(被我的其他插件大量使用),但有擴展使用的前景。我無法保證未來的支持或進一步開發,但應該會有。如果您發現任何錯誤或提出新功能,請善意告知我: [email protected]。
查看使用方法和常見問題以了解更多信息。
API
定義:
WLS
在使用任何 wls 函數之前應先檢查
WLS_VERSION
應(!)包含當前 WLS 版本字符串
嚴重程度級別:
WLS_NOCATEGORY = 0
WLS_INFO = 1
WLS_NOTICE = 2
WLS_WARNING = 3
WLS_ERROR = 4
WLS_FATALERROR = 5
函數:
wls_is_registered( $category_name );
如果$category_name已註冊,則返回true
wls_register( $category_name, $description );
註冊$category_name作為日誌類別
$description將顯示在管理區域中
wls_clear( $category_name );
刪除指定類別的所有日誌條目
wls_unregister( $category_name );
相當於使用wls_clear並從列表中刪除類別$category_name
wls_log( $category_name, $text, $user_id, $date, $blog_id, $severity = 0 );
將新的日誌條目插入到指定的類別中
$date必須按照 ISO 8601 格式化
$severity應該是預定義的嚴重程度級別之一(見上文)
wls_simple_log( $log_name, $text, $severity = 0 );
相當於wls_log( $category_name, $text, get_current_user_id(), date('c'), get_current_blog_id(), $severity);
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
This plugin provides a simple API for storing miscellaneous log entries and their overview in admin area (or network
admin area, if activated on a multisite).
Developed for private use (heavily used by my other plugins), but has perspective for more extensive usage. I can’t guarantee any support in the future nor further development, but it is to be expected. Kindly inform me about bugs, if you find any, or propose new features: [email protected].
See Usage and FAQ for more information.
API
Definitions:
WLS
should be checked before using any wls function
WLS_VERSION
should(!) contain current WLS version string
severity levels:
WLS_NOCATEGORY = 0
WLS_INFO = 1
WLS_NOTICE = 2
WLS_WARNING = 3
WLS_ERROR = 4
WLS_FATALERROR = 5
Functions:
wls_is_registered( $category_name );
returns true, if $category_name is registered
wls_register( $category_name, $description );
registers $category_name as a log category.
$description will be shown in admin area
wls_clear( $category_name );
deletes all log entries of category $category_name
wls_unregister( $category_name );
same as wls_clear & removes category $category_name from the list
wls_log( $category_name, $text, $user_id, $date, $blog_id, $severity = 0 );
inserts a new log entry into specified category
$date must be formated according to ISO 8601
$severity should be one of defined severity levels (see above)
wls_simple_log( $log_name, $text, $severity = 0 );
equivalent to wls_log( $category_name, $text, get_current_user_id(), date( 'c' ), get_current_blog_id(), $severity);
