lager icon indicating copy to clipboard operation
lager copied to clipboard

Pid is sometimes a pid and sometimes a string

Open eproxus opened this issue 11 years ago • 2 comments

The tag pid is sometimes assigned as a real Erlang pid and sometimes a string representing the pid:

2014-08-27T10:40:41.641Z INFO     Application sasl started on node 'mynode' <0.7.0>
2014-08-27T10:58:00.168Z INFO     test "<0.180.0>"

This makes it hard to write proper formatted log output since neither ~s or ~p can be used satisfactory. ~s will in fact crash lager and ~p will show the quotes.

eproxus avatar Aug 27 '14 09:08 eproxus

Seems the offending line is here:

https://github.com/basho/lager/blob/4d8291edb72a25ac0efde907e2ecaa115108ff90/src/lager_transform.erl#L94

For some reason Lager wraps self() in pid_to_list/1.

eproxus avatar Aug 27 '14 09:08 eproxus

Ok, seems the situation is a bit more messy than that. So far, the 3 possible values for this parameter seems to be:

  • A pid
  • A string
  • The atom emulator

eproxus avatar Aug 27 '14 09:08 eproxus