aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/global.erl
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2016-09-10 21:02:47 +0200
committerLuis Rascao <[email protected]>2016-09-19 14:12:22 +0100
commitdb12deff975c013a0ac02cfb49a339f8e6af5938 (patch)
treedb7182c9cd0ca4c5997fbd8bbc2036d9603c3df6 /lib/kernel/src/global.erl
parent687eae1e86817403249f03f534a256a28c5d5251 (diff)
downloadotp-db12deff975c013a0ac02cfb49a339f8e6af5938.tar.gz
otp-db12deff975c013a0ac02cfb49a339f8e6af5938.tar.bz2
otp-db12deff975c013a0ac02cfb49a339f8e6af5938.zip
Allow for easier enabling of distribution debug
Also update already deprecated calls.
Diffstat (limited to 'lib/kernel/src/global.erl')
-rw-r--r--lib/kernel/src/global.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl
index 0c73ead7c5..5e8bc2ba5d 100644
--- a/lib/kernel/src/global.erl
+++ b/lib/kernel/src/global.erl
@@ -58,14 +58,18 @@
%%% In certain places in the server, calling io:format hangs everything,
%%% so we'd better use erlang:display/1.
%%% my_tracer is used in testsuites
--define(trace(_), ok).
+%% uncomment this if tracing is wanted
+%%-define(DEBUG, true).
+-ifdef(DEBUG).
+-define(trace(T), erlang:display({format, node(), cs(), T})).
+ cs() ->
+ {_Big, Small, Tiny} = erlang:timestamp(),
+ (Small rem 100) * 100 + (Tiny div 10000).
%-define(trace(T), (catch my_tracer ! {node(), {line,?LINE}, T})).
-
-%-define(trace(T), erlang:display({format, node(), cs(), T})).
-%cs() ->
-% {_Big, Small, Tiny} = now(),
-% (Small rem 100) * 100 + (Tiny div 10000).
+-else.
+-define(trace(_), ok).
+-endif.
%% These are the protocol versions:
%% Vsn 1 is the original protocol.