rb(3)
β¨ rb(3) β the Report Browser Tool, but make it make sense π
okay so bestie, we're talking about rb, aka The Report Browser Tool πΈ β it lives over in the manual pages as rb(3) and it's genuinely one of those little gems you don't appreciate until you need it. Pull up a chair (or a beanbag, no judgement) π«Ά
π DESCRIPTION π
The Report Browser (RB) tool is for browsing and formatting error reports β the ones written by the error logger handler log_mf_h in STDLIB. That's it, that's the whole vibe. It reads your error logs and makes them cute and readable instead of a wall of unhinged text πβ¨
π DATA TYPES π
no cap, these are the shapes you'll be working with:
filter() ::
{Key :: term(), Value :: term()} |
{Key :: term(), Value :: term(), no} |
{Key :: term(), RegExp :: regexp(), re} |
{Key :: term(), RegExp :: regexp(), re, no}.
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() ::
string() |
{string(), Options :: [re:options()]} |
re:mp() |
{re:mp(), Options :: [re:compile_options()]}.
type() ::
error | error_report | info_msg | info_report | warning_msg |
warning_report | crash_report | supervisor_report | progress |
all.
it's giving "small but mighty", honestly π₯
π FUNCTIONS π
πΈ filter(Filters, Dates) -> term()
when
Filters :: [filter()],
Dates ::
{DateFrom, DateTo} |
{DateFrom, from} |
{DateTo, to},
DateFrom :: calendar:datetime(),
DateTo :: calendar:datetime().
Displays the reports that match the filters you handed it, periodt.
When a filter includes the no atom, it excludes the reports that match that filter (it's a "not this one, bestie" filter π).
The reports get matched using the proplists module in STDLIB. Important: the report must be a proplist to be matched against any of the filters. no proplist, no matching, that's the rule β¨
If the filter has the form {Key, RegExp, re}, the report must contain an element with key equal to Key, and the value must match the regular expression RegExp.
If the parameter Dates is specified, the reports are filtered according to the date when they occurred, like:
- If
Dateshas the form{DateFrom, from}, reports that occurred afterDateFromare displayed. - If
Dateshas the form{DateTo, to}, reports that occurred beforeDateToare displayed. - If two
Datesare specified, reports that occurred between those dates are returned.
To filter only by dates, just pass the empty list as the Filters parameter β iconic move π
For details about parameter RegExp, see rb:grep/1.
For details about data type mp(), see re:mp/0.
For details about data type datetime(), see calendar:datetime/0.
π grep(RegExp :: regexp()) -> term().
All reports matching the regular expression RegExp are displayed. RegExp can be any of the following:
- a string containing the regular expression
- a tuple with the string and the options for compilation
- a compiled regular expression
- a compiled regular expression and the options for running it
For a definition of valid regular expressions and options, see the re module in STDLIB β and in particular function re:run/3.
For details about data type mp(), see re:mp/0.
π help() -> term().
Displays online help information. the "just tell me what to do" button, we love her π«Ά
π§ list(Type :: type()) -> term().
Lists all reports loaded in rb_server. Each report is given a unique number that you can use as a reference to the report in function show/1.
If no Type is specified, all reports are listed. slay.
π log_list(Type :: type()) -> term().
Same as functions list/0 or list/1, but the result is printed to a log file, if set; otherwise to standard_io.
If no Type is specified, all reports are listed.
β rescan(Options) -> term()
when Options :: [option()].
Rescans the report directory. Options is the same as for function start/1. little refresh moment π
π show() -> term().
All reports are displayed. that's it. every single one. main character energy π
π¦ show(Report) -> term()
when Report :: integer() | type().
If argument Report is specified as one of the values of type(), all loaded reports of that type are displayed. If Report is specified as an integer, the report with this reference number is displayed.
β¨ start(Options) -> term()
when Options :: [option()].
Function start/1 starts rb_server with the specified options, whereas function start/0 starts with default options.
rb_server must be started before reports can be browsed. When rb_server is started, the files in the specified directory are scanned. All the other functions just assume that the server has already started β so like, start it first, bestie π
Options:
{start_log, FileName}β Starts logging to file, registered name, orio_device. All reports are printed to the specified destination. Default isstandard_io. Option{start_log, standard_error}is not allowed and will be replaced by defaultstandard_io.{max, MaxNoOfReports}β Controls how many reportsrb_serveris to read at startup. This option is useful, because the directory can contain a large amount of reports. If this option is specified, theMaxNoOfReportslatest reports are read. Default isall.{report_dir, DirString}β Defines the directory where the error log files are located. Default is the directory specified by application environment variableerror_logger_mf_dir, seesasl(6).{type, ReportType}β Controls what kind of reportsrb_serveris to read at startup.ReportTypeis a supported type,all, or a list of supported types. Default isall.{abort_on_error, Bool}β Specifies if logging is to be ended ifrbencounters an unprintable report. (You can get a report with an incorrect form if functionerror_logger,error_msg, orinfo_msghas been called with an invalid format string.)- If
Boolistrue,rbstops logging (and prints an error message tostdout) if it encounters a badly formatted report. If logging to file is enabled, an error message is appended to the log file as well. - If
Boolisfalse(the default value),rbprints an error message tostdoutfor every bad report it encounters, but the logging process is never ended. All printable reports are written. If logging to file is enabled,rbprints* UNPRINTABLE REPORT *in the log file at the location of an unprintable report.
- If
β οΈ heads up: thatstandard_errorthing is a hard no, and those unprintable reports are real β pick yourabort_on_errorwisely, bestie π
πΈ start_log(FileName) -> term()
when FileName :: string() | atom() | pid().
Redirects all report output from the RB tool to the specified file, registered name, or io_device.
π« stop() -> term().
Stops rb_server. bye bb π
π stop_log() -> term().
Closes the log file. The output from the RB tool is directed to standard_io.
and that's the whole page, bestie!! π go forth and browse those reports, you absolute legend π
Ericsson AB made this one, and it's chilling in sasl 4.4 as rb(3) β say thank you to the Erlang girlies, they ate fr fr πβ¨π¦
π¦ where this page comes from
- nixos 26.05: erlang 29.1.2
- nixpkgs unstable: erlang 29.1.2
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms