# rb

### MODULE

rb

### MODULE SUMMARY

The Report Browser Tool

### DESCRIPTION

The Report Browser (RB) tool makes it possible to browse and format error reports written by the error logger handler `log_mf_h`.

### EXPORTS

`grep(RegExp)`

Types:

`RegExp = string()`

All reports containing the regular expression `RegExp` are printed.

`RegExp` is a string containing the regular expression. Refer to the module `regexp` in the STDLIB reference manual for a definition of valid regular expressions. They are essentially the same as the UNIX command `egrep`.

`h()`
`help()`

Prints the on-line help information.

`list()`
`list(Type)`

Types:

`Type = type()`
`type() = crash_report | supervisor_report | error | progress`

This function lists all reports loaded in the `rb_server`. Each report is given a unique number that can be used as a reference to the report in the `show/1` function.

If no `Type` is given, all reports are listed.

`rescan()`
`rescan(Options)`

Types:

`Options = [opt()]`

Rescans the report directory. `Options` is the same as for `start()`.

`show()`
`show(Report)`

Types:

`Report = int() | type()`

If a type argument is given, all loaded reports of this type are printed. If an integer argument is given, the report with this reference number is printed. If no argument is given, all reports are shown.

`start()`
`start(Options)`

Types:

`Options = [opt()]`
`opt() = {start_log, FileName} | {max, MaxNoOfReports} | {report_dir, DirString} | {type, ReportType} | {abort_on_error, Bool}`
`FileName = string() | standard_io`
`MaxNoOfReports = int() | all`
`DirString = string()`
`ReportType = type() | [type()] | all`
`Bool = true | false`

The function `start/1` starts the `rb_server` with the specified options, while `start/0` starts with default options. The `rb_server` must be started before reports can be browsed. When the `rb_server` is started, the files in the specified directory are scanned. The other functions assume that the server has started.

`{start_log, FileName}` starts logging to file. All reports will be printed to the named file. The default is `standard_io`.

`{max, MaxNoOfReports}`. Controls how many reports the `rb_server` should read on start-up. This option is useful as the directory may contain 20.000 reports. If this option is given, the `MaxNoOfReports` latest reports will be read. The default is 'all'.

`{report_dir, DirString}`. Defines the directory where the error log files are located. The default is `{sasl, error_logger_mf_dir}`.

`{type, ReportType}`. Controls what kind of reports the `rb_server` should read on start-up. `ReportType` is a supported type, 'all', or a list of supported types. The default is 'all'.

`{abort_on_error, Bool}`. This option specifies whether or not logging should be aborted if rb encounters an unprintable report. (You may get a report on incorrect form if the `error_logger` function `error_msg` or `info_msg` has been called with an invalid format string). If `Bool` is `true`, rb will stop logging (and print an error message to stdout) if it encounters a badly formatted report. If logging to file is enabled, an error message will be appended to the log file as well. If `Bool` is `false` (which is the default value), rb will print an error message to stdout for every bad report it encounters, but the logging process is never aborted. All printable reports will be written. If logging to file is enabled, rb prints `* UNPRINTABLE REPORT *` in the log file at the location of an unprintable report.

`start_log(FileName)`

Types:

`FileName = string()`

Redirects all report output from the RB tool to the specified file.

`stop()`

Stops the `rb_server`.

`stop_log()`

Closes the log file. The output from the RB tool will be directed to `standard_io`.

### AUTHORS

Martin Björklund - support@erlang.ericsson.se

sasl 2.1.4
Copyright © 1991-2007 Ericsson AB