檢視原始碼 rb (sasl v4.2.2)

報表瀏覽工具

報表瀏覽器 (RB) 工具用於瀏覽和格式化由 STDLIB 中的錯誤日誌處理器 log_mf_h 寫入的錯誤報表。

摘要

函式

等同於 filter/2

顯示符合所提供過濾器的報表。

顯示所有符合正規表示式 RegExp 的報表。RegExp 可以是以下任何一種:

h()

等同於 help()

顯示線上說明資訊。

等同於 list(all)

列出在 rb_server 中載入的所有報表。每個報表都會給予一個獨特的編號,可用於在函式 show/1 中作為報表的參考。

等同於 log_list(all)

與函式 list/0list/1 相同,但結果會列印到日誌檔案(如果已設定);否則會列印到 standard_io

等同於 rescan([])

重新掃描報表目錄。Options 與函式 start/1 的選項相同。

顯示所有報表。

如果參數 Report 指定為 type() 的其中一個值,則會顯示所有已載入的該類型報表。如果 Report 指定為整數,則會顯示具有此參考編號的報表。

等同於 start([])

函式 start/1 使用指定的選項啟動 rb_server,而函式 start/0 使用預設選項啟動。

將 RB 工具的所有報表輸出重新導向至指定的檔案、註冊名稱或 io_device

停止 rb_server

關閉日誌檔案。RB 工具的輸出會導向至 standard_io

型別

此型別的連結

filter()

檢視原始碼 (未匯出)
-type filter() ::
          {Key :: term(), Value :: term()} |
          {Key :: term(), Value :: term(), no} |
          {Key :: term(), RegExp :: regexp(), re} |
          {Key :: term(), RegExp :: regexp(), re, no}.
此型別的連結

option()

檢視原始碼 (未匯出)
-type option() ::
          {start_log, FileName :: string() | atom() | pid()} |
          {max, MaxNoOfReports :: integer() | all} |
          {report_dir, DirString :: string()} |
          {type, ReportType :: type() | [type()] | all} |
          {abort_on_error, boolean()}.
此型別的連結

regexp()

檢視原始碼 (未匯出)
-type regexp() ::
          string() |
          {string(), Options :: [re:options()]} |
          re:mp() |
          {re:mp(), Options :: [re:compile_options()]}.
-type type() ::
          error | error_report | info_msg | info_report | warning_msg | warning_report | crash_report |
          supervisor_report | progress | all.

函式

此函式的連結

filter(Filters)

檢視原始碼 (自 OTP R13B04 起)
-spec filter(Filters) -> term() when Filters :: [filter()].

等同於 filter/2

此函式的連結

filter(Filters, Dates)

檢視原始碼 (自 OTP R13B04 起)
-spec filter(Filters, Dates) -> term()
                when
                    Filters :: [filter()],
                    Dates :: {DateFrom, DateTo} | {DateFrom, from} | {DateTo, to},
                    DateFrom :: calendar:datetime(),
                    DateTo :: calendar:datetime().

顯示符合所提供過濾器的報表。

當過濾器包含 no 原子時,它會排除符合該過濾器的報表。

報表會使用 STDLIB 中的 proplists 模組進行比對。報表必須是屬性列表,才能與任何過濾器進行比對。

如果過濾器具有 {Key, RegExp, re} 的形式,則報表必須包含一個鍵等於 Key 的元素,且該值必須符合正規表示式 RegExp

如果指定了參數 Dates,則會根據報表發生的日期進行過濾。如果 Dates 具有 {DateFrom, from} 的形式,則會顯示 DateFrom 之後發生的報表。

如果 Dates 具有 {DateTo, to} 的形式,則會顯示 DateTo 之前發生的報表。

如果指定了兩個 Dates,則會傳回在這兩個日期之間發生的報表。

若要僅按日期篩選,請指定空列表作為 Filters 參數。

有關參數 RegExp 的詳細資訊,請參閱 rb:grep/1

有關資料型別 mp() 的詳細資訊,請參閱 re:mp/0

有關資料型別 datetime() 的詳細資訊,請參閱 calendar:datetime/0

-spec grep(RegExp :: regexp()) -> term().

顯示所有符合正規表示式 RegExp 的報表。RegExp 可以是以下任何一種:

  • 包含正規表示式的字串
  • 包含字串和編譯選項的元組
  • 已編譯的正規表示式
  • 已編譯的正規表示式和執行選項

有關有效正規表示式和選項的定義,請參閱 STDLIB 中的 re 模組,特別是函式 re:run/3

有關資料型別 mp() 的詳細資訊,請參閱 re:mp/0

-spec h() -> term().

等同於 help()

-spec help() -> term().

顯示線上說明資訊。

-spec list() -> term().

等同於 list(all)

-spec list(Type :: type()) -> term().

列出在 rb_server 中載入的所有報表。每個報表都會給予一個獨特的編號,可用於在函式 show/1 中作為報表的參考。

如果未指定 Type,則會列出所有報表。

此函式的連結

log_list()

檢視原始碼 (自 OTP R16B02 起)
-spec log_list() -> term().

等同於 log_list(all)

此函式的連結

log_list(Type)

檢視原始碼 (自 OTP R16B02 起)
-spec log_list(Type :: type()) -> term().

與函式 list/0list/1 相同,但結果會列印到日誌檔案(如果已設定);否則會列印到 standard_io

如果未指定 Type,則會列出所有報表。

-spec rescan() -> term().

等同於 rescan([])

-spec rescan(Options) -> term() when Options :: [option()].

重新掃描報表目錄。Options 與函式 start/1 的選項相同。

-spec show() -> term().

顯示所有報表。

-spec show(Report) -> term() when Report :: integer() | type().

如果參數 Report 指定為 type() 的其中一個值,則會顯示所有已載入的該類型報表。如果 Report 指定為整數,則會顯示具有此參考編號的報表。

-spec start() -> term().

等同於 start([])

-spec start(Options) -> term() when Options :: [option()].

函式 start/1 使用指定的選項啟動 rb_server,而函式 start/0 使用預設選項啟動。

必須先啟動 rb_server,才能瀏覽報表。當啟動 rb_server 時,會掃描指定目錄中的檔案。其他函式假設伺服器已啟動。

選項

  • {start_log, FileName} - 開始記錄到檔案、註冊名稱或 io_device。所有報表都會列印到指定目的地。預設值為 standard_io。不允許選項 {start_log, standard_error},並且將替換為預設值 standard_io

  • {max, MaxNoOfReports} - 控制 rb_server 在啟動時要讀取的報表數量。此選項很有用,因為目錄可能包含大量報表。如果指定此選項,則會讀取最新的 MaxNoOfReports 個報表。預設值為 all

  • {report_dir, DirString} - 定義錯誤日誌檔案所在的目錄。預設值為應用程式環境變數 error_logger_mf_dir 指定的目錄,請參閱 sasl(6)

  • {type, ReportType} - 控制 rb_server 在啟動時要讀取的報表類型。ReportType 是支援的類型、all 或支援類型的列表。預設值為 all

  • {abort_on_error, Bool} - 指定如果 rb 遇到無法列印的報表時,是否要結束記錄。(如果函式 error_loggererror_msginfo_msg 在呼叫時使用了無效的格式字串,則可能會取得格式不正確的報表)

    • 如果 Booltrue,則 rb 會在遇到格式錯誤的報表時停止記錄(並在 stdout 列印錯誤訊息)。如果啟用記錄到檔案,則也會將錯誤訊息附加到日誌檔案中。
    • 如果 Boolfalse(預設值),則 rb 會針對遇到的每個錯誤報表在 stdout 列印錯誤訊息,但永遠不會結束記錄程序。將會寫入所有可列印的報表。如果啟用記錄到檔案,則 rb 會在日誌檔案中無法列印的報表位置列印 * UNPRINTABLE REPORT *
-spec start_log(FileName) -> term() when FileName :: string() | atom() | pid().

將 RB 工具的所有報表輸出重新導向至指定的檔案、註冊名稱或 io_device

-spec stop() -> term().

停止 rb_server

-spec stop_log() -> term().

關閉日誌檔案。RB 工具的輸出會導向至 standard_io