1%%-define(debug, true).
2
3-ifdef(debug).
4-define(DEBUG0(F), ?SAFE(io:format(F, []))).
5-define(DEBUG(F, A), ?SAFE(io:format(F, A))).
6-else.
7-define(DEBUG0(F), ok).
8-define(DEBUG(F, A), ok).
9-endif.
10
11-define(pprint(F), io:format("~p~n", [amqp10_framing:pprint(F)])).
12
13-define(SAFE(F),
14        ((fun() ->
15                  try F
16                  catch __T:__E ->
17                          io:format("~p:~p thrown debugging~n~p~n",
18                                    [__T, __E, erlang:get_stacktrace()])
19                  end
20          end)())).
21
22%% General consts
23
24-define(FRAME_1_0_MIN_SIZE, 512).
25
26-define(SEND_ROLE, false).
27-define(RECV_ROLE, true).
28
29%% Encoding
30
31-include_lib("amqp10_common/include/amqp10_framing.hrl").
32
33-define(INFO_ITEMS, [pid,
34                     auth_mechanism,
35                     host,
36                     frame_max,
37                     timeout,
38                     user,
39                     state,
40                     recv_oct,
41                     recv_cnt,
42                     send_oct,
43                     send_cnt,
44                     ssl,
45                     ssl_protocol,
46                     ssl_key_exchange,
47                     ssl_cipher,
48                     ssl_hash,
49                     peer_cert_issuer,
50                     peer_cert_subject,
51                     peer_cert_validity,
52                     node]).
53