I have some references in logs and I need to transform them from text to real references so I can compare then with ets references.
Logs and Code
I have some logs that print some errors in the form of: "Unexpected message: {#Ref<0.427740394.3330539535.243656>,badarg}",
Now, I have some references I got from using table_ref = :ets.whereis :foo. I need to convert the reference I got from the log into something I can compare against table_ref to find out if table_ref is the same as log_ref.
Already thought about that… didn’t work out as expected:
iex(12)> to_string(:ets.whereis IEx.Pry)
** (Protocol.UndefinedError) protocol String.Chars not implemented for #Reference<0.3188431698.1701707783.210630>
(elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
(elixir) lib/string/chars.ex:22: String.Chars.to_string/1
From what I understand, erlang has no way of converting references to strings, which is confusing because since they are written in the logs, there must be a way of doing so.