Storing pids

Mats Cronqvist <>
Thu Jan 5 13:23:43 CET 2006


   well, the node id number in the pid is worthless for logging (numbering is 
different on each erlang node).
   try this;

 > PID=self().
 > [node(PID)|lists:map(fun erlang:list_to_integer/1, 
tl(string:tokens(erlang:pid_to_list(PID),"<>.")))].
[,31,0]

   mats

Joel Reymont wrote:
> Well, my intent is to log from different nodes so I can't discard the  
> node id :-(.
> 
> Thanks for the tip, though!
> 
> On Jan 5, 2006, at 11:40 AM, Mats Cronqvist wrote:
> 
>>   fwiw, i always discard the first (node id) digit when logging pids.
>>
>> > tl(string:tokens(erlang:pid_to_list(self()),"<>.")).
>> ["31","0"]
> 
> 
> -- 
> http://wagerlabs.com/
> 
> 
> 
> 
> 



More information about the erlang-questions mailing list