From e99ec8e235beb16d35e5a940b814061fb87db989 Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Tue, 22 Dec 2009 22:54:07 +0800 Subject: New rb:filter/1 function to ease report filtering Currently in the rb module the only way to filter reports is by using the grep/1 or re/1 functions that use Regular Expressions. This new function allow us to specify detailed filters that will match against our reports. Since the reports are proplists the filters are tuples of the form {Key, Value}. If the report contains that tuple, it will be displayed. Usage: 1> rb:filter([{"foo", "bar"}, {"abc", "value"}]). 2> rb:filter([{"foo", "bar", no}]). % excludes reports containing {"foo", "bar"} 3> rb:filter([{"foo", RegExp, re}]). % the report must contain an element with Key = "foo" % and Value must match RegExp --- lib/sasl/doc/src/rb.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'lib/sasl/doc') diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml index 810f7dca6b..0b5df29333 100644 --- a/lib/sasl/doc/src/rb.xml +++ b/lib/sasl/doc/src/rb.xml @@ -42,6 +42,32 @@

+ + filter(Filters) + Filter reports and displays them on the screen + + Filters = [filter()] + filter() = {Key, Value} | {Key, Value, no} | {Key, RegExp, re} | {Key, RegExp, re, no} + Key = term() + Value = term() + RegExp = string() | {string, Options} | mp(), {mp(), Options} + + +

This function displays the reports that match the provided filters.

+

+ When a filter includes the no atom it will exclude the reports that match + that filter. +

+

+ The reports are matched using the proplists module. The report must be a proplist + to be matched against any of the filters(). +

+

+ If the filter is of the form {Key, RegExp, re} the report must contain an element with + key = Key and Value must match the RegExp regular expression. +

+
+
grep(RegExp) Search the reports for a regular expression -- cgit v1.2.3