diff options
author | Siri Hansen <[email protected]> | 2018-12-17 16:24:41 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2019-01-16 09:59:24 +0100 |
commit | dc9108ff7a4414d702fb8006df82668309ad3d5b (patch) | |
tree | 3b64395f086c1fb06c3ef875fb16127142748f88 /lib/kernel/src/logger.erl | |
parent | b28f162139049a3105e33936cbbef1f0fa3a30f1 (diff) | |
download | otp-dc9108ff7a4414d702fb8006df82668309ad3d5b.tar.gz otp-dc9108ff7a4414d702fb8006df82668309ad3d5b.tar.bz2 otp-dc9108ff7a4414d702fb8006df82668309ad3d5b.zip |
[logger] Use persistent_term for storing proxy reference
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r-- | lib/kernel/src/logger.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl index 0ab3addfef..f05e756fd0 100644 --- a/lib/kernel/src/logger.erl +++ b/lib/kernel/src/logger.erl @@ -937,14 +937,13 @@ log_allowed(Location,Level,Msg,Meta0) when is_map(Meta0) -> %% (function or macro). Meta = add_default_metadata( maps:merge(Location,maps:merge(proc_meta(),Meta0))), - Tid = tid(), case node(maps:get(gl,Meta)) of Node when Node=/=node() -> - log_remote(Node,Level,Msg,Meta,Tid), - do_log_allowed(Level,Msg,Meta,Tid); + log_remote(Node,Level,Msg,Meta); _ -> - do_log_allowed(Level,Msg,Meta,Tid) - end. + ok + end, + do_log_allowed(Level,Msg,Meta,tid()). do_log_allowed(Level,{Format,Args}=Msg,Meta,Tid) when ?IS_LEVEL(Level), @@ -967,13 +966,13 @@ do_log_allowed(Level,String,Meta,Tid) tid() -> ets:whereis(?LOGGER_TABLE). -log_remote(Node,Level,{Format,Args},Meta,Tid) -> - log_remote(Node,{log,Level,Format,Args,Meta},Tid); -log_remote(Node,Level,Msg,Meta,Tid) -> - log_remote(Node,{log,Level,Msg,Meta},Tid). +log_remote(Node,Level,{Format,Args},Meta) -> + log_remote(Node,{log,Level,Format,Args,Meta}); +log_remote(Node,Level,Msg,Meta) -> + log_remote(Node,{log,Level,Msg,Meta}). -log_remote(Node,Request,Tid) -> - logger_proxy:log(logger_server:get_proxy_ref(Tid),{remote,Node,Request}), +log_remote(Node,Request) -> + logger_proxy:log({remote,Node,Request}), ok. add_default_metadata(Meta) -> |