aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/doc/src
diff options
context:
space:
mode:
authorAlvaro Videla <[email protected]>2009-12-22 22:54:07 +0800
committerBjörn Gustavsson <[email protected]>2010-02-14 12:15:09 +0100
commite99ec8e235beb16d35e5a940b814061fb87db989 (patch)
tree09e69df34ebaef9c380fdbb045abc755831bcba2 /lib/sasl/doc/src
parent501b9236450bc1f38d3daf9d9f0dc60b72299d6c (diff)
downloadotp-e99ec8e235beb16d35e5a940b814061fb87db989.tar.gz
otp-e99ec8e235beb16d35e5a940b814061fb87db989.tar.bz2
otp-e99ec8e235beb16d35e5a940b814061fb87db989.zip
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
Diffstat (limited to 'lib/sasl/doc/src')
-rw-r--r--lib/sasl/doc/src/rb.xml26
1 files changed, 26 insertions, 0 deletions
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
@@ -43,6 +43,32 @@
</description>
<funcs>
<func>
+ <name>filter(Filters)</name>
+ <fsummary>Filter reports and displays them on the screen</fsummary>
+ <type>
+ <v>Filters = [filter()]</v>
+ <v>filter() = {Key, Value} | {Key, Value, no} | {Key, RegExp, re} | {Key, RegExp, re, no}</v>
+ <v>Key = term()</v>
+ <v>Value = term()</v>
+ <v>RegExp = string() | {string, Options} | mp(), {mp(), Options}</v>
+ </type>
+ <desc>
+ <p>This function displays the reports that match the provided filters.</p>
+ <p>
+ When a filter includes the <c>no</c> atom it will exclude the reports that match
+ that filter.
+ </p>
+ <p>
+ The reports are matched using the <c>proplists</c> module. The report must be a proplist
+ to be matched against any of the <c>filters()</c>.
+ </p>
+ <p>
+ If the filter is of the form <c>{Key, RegExp, re}</c> the report must contain an element with
+ <c>key = Key</c> and <c>Value</c> must match the RegExp regular expression.
+ </p>
+ </desc>
+ </func>
+ <func>
<name>grep(RegExp)</name>
<fsummary>Search the reports for a regular expression</fsummary>
<type>