wc = RealmSession.subscribe(db, realm, topic, {id, {self(), Node.self()}}, opts)
send_to_peer(Broker.subscribed(%Subscribed{request_id: rid, subscription_id: id}), tt, t)
- Logger.info("Subscription #{id}: #{topic}")
+ Logger.info("Subscription #{id}: #{realm} - #{topic}")
{%SL{sl | data: %Sess{data | subscriptions: [{id, topic, wc} | subs]}},
[{:next_event, :internal, :transition}]}
subs = RealmSession.unsubscribe(db, realm, {subscription_id, {self(), Node.self()}}, subs)
send_to_peer(Broker.unsubscribed(%Unsubscribed{request_id: rid}), tt, t)
- Logger.info("Unsubscribe: #{subscription_id}")
+ Logger.info("Unsubscribe: #{realm} - #{subscription_id}")
{:ok, %SL{sl | data: %Sess{sl.data | subscriptions: subs}}, [{:next_event, :internal, :transition}]}
end
:noop
end
- Logger.info("Published #{pub_id}: #{topic}")
+ Logger.info("Published #{pub_id}: #{realm} - #{topic}")
{sl, [{:next_event, :internal, :transition}]}
false ->
regs = RealmSession.unregister(db, realm, {registration_id, {self(), Node.self()}}, regs)
send_to_peer(Dealer.unregistered(%Unregistered{request_id: request_id}), tt, t)
- Logger.info("Unregister: #{registration_id}")
+ Logger.info("Unregister: #{realm} - #{registration_id}")
{:ok, %SL{sl | data: %Sess{data | registrations: regs}}, [{:next_event, :internal, :transition}]}
end
regd = %Registered{request_id: rid, registration_id: id}
send_to_peer(Dealer.registered(regd), tt, t)
- Logger.info("Registered #{id}: #{procedure}")
+ Logger.info("Registered #{id}: #{realm} - #{procedure}")
{%SL{sl | data: %Sess{data | registrations: [{id, procedure} | regs]}},
[{:next_event, :internal, :transition}]}
RealmSession.round_robin(db, realm, proc, length(callees))
- Logger.info("Call #{req_id}: #{proc}")
+ Logger.info("Call #{req_id}: #{realm} - #{proc}")
{%SL{sl | data: %Sess{data | request_id: req_id}}, [{:next_event, :internal, :transition}]}
else
{:error, :no_live_callees} ->
t
)
+ Logger.info("No Callees: #{realm} - #{proc}")
{sl, [{:next_event, :internal, :transition}]}
:not_found ->
data: %Sess{
proxy: proxy,
invocations: inv,
+ realm: realm,
yield: %Yield{request_id: id, options: opts, arg_list: arg_l, arg_kw: arg_kw}
}
} = data
_ -> true
end)
- Logger.info("Yield #{id}")
+ Logger.info("Yield: #{realm} - #{id}")
{:ok, %SL{data | data: %Sess{data.data | invocations: inv, yield: nil}}, [{:next_event, :internal, :transition}]}
end
data: %Sess{
proxy: proxy,
invocations: inv,
+ realm: realm,
error: %Error{request_id: id, details: dets, arg_list: arg_l, error: err, arg_kw: arg_kw}
}
} = data
_ -> true
end)
- Logger.info("Call Error #{id}: #{get_in(dets, ["procedure"])}")
+ Logger.info("Call Error #{id}: #{realm} - #{get_in(dets, ["procedure"])}")
{:ok, %SL{data | data: %Sess{data.data | invocations: inv}}, [{:next_event, :internal, :transition}]}
end
@handle_abort,
_,
@abort,
- %SL{data: %Sess{transport: tt, transport_pid: t, error: er}} = data
+ %SL{data: %Sess{transport: tt, transport_pid: t, realm: realm, error: er}} = data
) do
send_to_peer(Peer.abort(%Abort{reason: er}), tt, t)
- Logger.info("Abort")
+ Logger.info("Abort: #{realm} #{inspect(er)}")
{:ok, data, []}
end
@handle_goodbye,
_,
@goodbye,
- %SL{data: %Sess{transport: tt, transport_pid: t, goodbye: goodbye}} = data
+ %SL{data: %Sess{transport: tt, transport_pid: t, goodbye: goodbye, realm: realm}} = data
) do
send_to_peer(Peer.goodbye(goodbye), tt, t)
- Logger.info("Goodbye")
+ Logger.info("Goodbye: #{realm}")
{:ok, data, []}
end
t
)
+ Logger.info("Welcome #{authid}: #{realm}")
+
{[{:next_event, :internal, :transition}], proxy, peer}
{false, peer} ->