1 2 3 4 5 6 7 8 9 10 11 12
13 /*!
14 * ======== IFilterLogger ========
15 * Interface for supporting filtering of Log events by detail level.
16 *
17 * Filtering of events based on detail level is not inherently supported
18 * by the Log APIs as is filtering of events based on the diagnostics mask.
19 *
20 * Support for this type of filtering must be done by an `ILogger`
21 * implementation. Not all users are interested in this filtering support,
22 * however, so it is not required of all `ILogger` implementations.
23 *
24 * `ILoggers` that do intend to support filtering by detail level should
25 * implement this interface, which extends the `ILogger` interface.
26 *
27 * The `{@link #setFilterLevel}` and `{@link #getFilterLevel}` functions
28 * support runtime specification of a different filtering level for each of
29 * the diagnostics categories.
30 */
31 interface IFilterLogger inherits ILogger {
32
33 /*!
34 * ======== filterByLevel ========
35 * Support filtering of events by event level
36 *
37 * To improve logging performance, this feature can be disabled by setting
38 * `filterByLevel` to false.
39 *
40 * See '{@link #setFilterLevel}' for an explanation of level filtering.
41 */
42 config Bool filterByLevel = false;
43
44 instance:
45
46 /*!
47 * ======== setFilterLevel ========
48 * Set the level of detail that instances will log
49 *
50 * Events with the specified level or higher will be logged, events
51 * below the specified level will be dropped.
52 *
53 * Events are filtered first by diags category, then by level. If an
54 * event's diags category is disabled in the module's diags mask, then it
55 * will be filtered out regardless of level. The event will not even be
56 * passed to the logger.
57 *
58 * This API allows for setting the filtering level for more than one
59 * diags category at a time. The mask parameter can be a single category
60 * or multiple categories combined, and the level will be set for all of
61 * those categories.
62 *
63 * @param(mask) The diags categories to set the level for
64 * @param(filterLevel) The new filtering level for the specified
65 * categories
66 */
67 Void setFilterLevel(Diags.Mask mask, Diags.EventLevel filterLevel);
68
69 /*!
70 * ======== getFilterLevel ========
71 * Returns the mask of diags categories currently set to the specified
72 * level.
73 *
74 * See '{@link #setFilterLevel}' for an explanation of level filtering.
75 */
76 Diags.Mask getFilterLevel(Diags.EventLevel level);
77
78 }
79 80 81
82