File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,24 @@ class NetworkLogger {
43
43
_manager.setObfuscateLogCallback (callback);
44
44
}
45
45
46
+ /// Registers a callback to selectively omit network log data.
47
+ ///
48
+ /// Use this method to set a callback function that determines whether
49
+ /// specific network log data should be excluded before recording it.
50
+ ///
51
+ /// The [callback] function takes a [NetworkData] object as its argument and
52
+ /// should return a boolean value indicating whether the data should be omitted
53
+ /// (`true` ) or included (`false` ).
54
+ ///
55
+ /// Example:
56
+ ///
57
+ /// ```dart
58
+ /// NetworkLogger.omitLog((data) {
59
+ /// // Implement logic to decide whether to omit the data.
60
+ /// // For example, ignore requests to a specific URL:
61
+ /// return data.url.startsWith('https://example.com');
62
+ /// });
63
+ /// ```
46
64
static void omitLog (OmitLogCallback callback) {
47
65
_manager.setOmitLogCallback (callback);
48
66
}
Original file line number Diff line number Diff line change @@ -29,24 +29,6 @@ class NetworkManager {
29
29
return _obfuscateLogCallback !(data);
30
30
}
31
31
32
- /// Registers a callback to selectively omit network log data.
33
- ///
34
- /// Use this method to set a callback function that determines whether
35
- /// specific network log data should be excluded before recording or displaying it.
36
- ///
37
- /// The [callback] function takes a [NetworkData] object as its argument and
38
- /// should return a boolean value indicating whether the data should be omitted
39
- /// (true) or included (false).
40
- ///
41
- /// Example:
42
- ///
43
- /// ```dart
44
- /// NetworkLogger.omitLog((data) {
45
- /// // Implement logic to decide whether to omit the data.
46
- /// // For example, check if it contains a specific keyword and return false, otherwise return true.
47
- /// return someCondition ? true : false;
48
- /// });
49
- /// ```
50
32
FutureOr <bool > omitLog (NetworkData data) {
51
33
if (_omitLogCallback == null ) {
52
34
return false ;
You can’t perform that action at this time.
0 commit comments