aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-05-16 14:58:03 +0200
committerLukas Larsson <[email protected]>2018-05-21 17:43:53 +0200
commit4e9f0492fd46d1ba6d919883cbdd5caaff8a949b (patch)
treeec1a86fe0da1a0c06f0d26c89e503362d514ef54 /lib/kernel/src
parent0afab64f105c09976c7c07a64f54bf962ff9a18f (diff)
downloadotp-4e9f0492fd46d1ba6d919883cbdd5caaff8a949b.tar.gz
otp-4e9f0492fd46d1ba6d919883cbdd5caaff8a949b.tar.bz2
otp-4e9f0492fd46d1ba6d919883cbdd5caaff8a949b.zip
Add Action=differs to logger_filters:domain/2
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/logger_filters.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kernel/src/logger_filters.erl b/lib/kernel/src/logger_filters.erl
index 85928f0fd6..592ff28cc2 100644
--- a/lib/kernel/src/logger_filters.erl
+++ b/lib/kernel/src/logger_filters.erl
@@ -38,6 +38,7 @@ domain(#{meta:=Meta}=Log,{Action,Compare,MatchDomain})
(Compare==prefix_of orelse
Compare==starts_with orelse
Compare==equals orelse
+ Compare==differs orelse
Compare==no_domain) andalso
is_list(MatchDomain) ->
filter_domain(Compare,Meta,MatchDomain,on_match(Action,Log));
@@ -87,9 +88,12 @@ filter_domain(starts_with,#{domain:=Domain},MatchDomain,OnMatch) ->
is_prefix(MatchDomain,Domain,OnMatch);
filter_domain(equals,#{domain:=Domain},Domain,OnMatch) ->
OnMatch;
+filter_domain(differs,#{domain:=Domain},MatchDomain,OnMatch)
+ when Domain=/=MatchDomain ->
+ OnMatch;
filter_domain(Action,Meta,_,OnMatch) ->
case maps:is_key(domain,Meta) of
- false when Action==no_domain -> OnMatch;
+ false when Action==no_domain; Action==differs -> OnMatch;
_ -> ignore
end.