內容簡介
這個外掛是從已不再支援的WordPress Logging Service中衍生出來的
WordPress Logging Service。
雖然它與前者不兼容,也沒有從前面升級的方式。
特色
由外部API呼叫產生的紀錄條目,外掛本身不會產生任何記錄條目
自由文字類別的組織紀錄條目
嚴重程度等級
自由文字記錄訊息
條目可以標記為已見,並從再次顯示中過濾
按最低嚴重程度過濾
按日期,類別,使用者名稱,嚴重程度或網誌名稱排序(多站點安裝)
可以授予使用者角色訪問記錄頁面
API
常數
檢查外掛是否啟用:
CLGS = true
定義嚴重程度等級:
CLGS_NOSEVERITY = 0
CLGS_INFO = 1
CLGS_NOTICE = 2
CLGS_WARNING = 3
CLGS_ERROR = 4
CLGS_FATALERROR = 5
函式
clgs_is_registered ( $category )
string $category
如果已註冊了 $category,則返回true。
clgs_register ( $category, $description )
註冊$category作為日誌類別。$description將顯示在管理頁面上。
對於發佈日誌訊息的每個外掛來說,使用唯一的類別是一個好習慣。
string $category 最多190個(unicode)字元
string $description 可包含HTML,與評論相同(通過wp_kses_data篩選)
如果分類已註冊或過長,則返回false。
clgs_clear ( $category )
刪除$category的所有日誌條目。
string $description現有分類
返回刪除的條目數或false(如果操作失敗)。
clgs_unregister( $category );
刪除所有日誌條目,然後刪除$category。
string $description 現有分類
如果操作失敗,則返回false。
clgs_log( $category, $text, $severity = null, $user = null, $blog_id = null, $date = null );
在指定的分類中寫入新的記錄條目
string $description 註冊的分類名稱
string $text 記錄的消息,可包含HTML,與評論相同(通過wp_kses_data篩選)
int $severity 定義的嚴重程度等級之一(參見上文); 如果缺失,則預設為
CLGS_NOCATEGORY
int | string | WP_User $user user id,slug或WP user object都可以接受; 如果缺失
則默認為當前用戶(如果沒有登錄任何內容,則為占位符)
int $blog_id 網誌 id; 如果缺失,則預設為當前網誌
int | double | string $date 一個UNIX timestamp或一個被strtotime()識別的字符串;
如果缺失,則預設為當前時間
如果輸入日誌失敗,則返回false。
外掛標籤
開發者團隊
原文外掛簡介
This plugin is derived from the no longer supported
WordPress Logging Service.
Despite that it is not compatiple with it, and there is no upgrade path from one
to the other.
Features
No log entries generated by the plugin itself, all come from external API calls
Organisation of log entries in freetext categories
Severity levels
Freetext log messages
Entries can be marked as seen and then filtered from being displayed again
Filtering by minimum severity level
Sort by date, category, user name, severity or blog name (in Multisite installations)
Access to the log page can be granted by user role
API
Constants
Check to test if the plugin is active:
CLGS = true
Defined severity levels:
CLGS_NOSEVERITY = 0
CLGS_INFO = 1
CLGS_NOTICE = 2
CLGS_WARNING = 3
CLGS_ERROR = 4
CLGS_FATALERROR = 5
Functions
clgs_is_registered ( $category )
string $category
returns true if $category is registered.
clgs_register ( $category, $description )
registers $category as a log category. $description will be shown in the
management page.
It is good practice to use unique categories for each plugin that publishes
log messages.
string $category At most 190 (unicode) characters
string $description can contain HTML same as comments (filtered by
wp_kses_data)
returns false if the category is already registered or it is too long.
clgs_clear ( $category )
deletes all log entries of $category.
string $description existing category
returns number of deleted entries or false if action failed.
clgs_unregister( $category );
deletes all log entries and then removes $category.
string $description existing category
returns false if false if action failed.
clgs_log( $category, $text, $severity = null, $user = null, $blog_id = null, $date = null );
writes a new log entry in the specified category
string $description a registered category name
string $text the logged message, can contain HTML same as comments (filtered
by wp_kses_data)
int $severity one of defined severity levels (see above); if missing defaults to
CLGS_NOCATEGORY
int | string | WP_User $user user id, slug or WP user object are aceptable; if missing
defaults to current user (or a placeholder if none is logged in)
int $blog_id blog id; if missing defaults to current blog
int | double | string $date a UNIX timestamp or a string recognized by strtotime();
if missing defaults to current time
returns false if entering the log failed.
