Is it possible to use Rexbug to trace messages send/received by processes?

I’m not really sure about redbug, but with dbg captureing a process that sends {ref, :badarg} messages would look something like:

# start the logger process
:dbg.tracer()
# set the match spec to only capture {ref, :badarg} messages
# will only trace messages received by receiver, can be :_ to trace all processes as receivers
:dbg.tpe(:send, [{[receiver, {:"$1", :badarg}],[{:is_reference,:"$1"}],[]}])
# start the trace on sender, can also be :processes to trace all processes as senders
:dbg.p(sender, [:r]); 

You’ll start receiving log messages in the shape of:

(<0.108.0>) <0.117.0> ! {#Ref<0.3800804343.3707502597.14282>,badarg}

Which means process <0.108.0> sent the above message to <0.117.0>.