[strongSwan-dev] [PATCH 8/8] Use thread id as retrieved by gettid in log messages
tobias at strongswan.org
Wed Dec 14 19:00:19 CET 2011
> Especially when working with core dumps it proved useful to have
> charon's log messages prefixed with the thread id instead of the
> human readable thread number.
Changing the current human-readable thread number to the actual thread
ID makes the logs quite a bit harder to read. Not only are the IDs
longer than the numbers, their range also varies significantly between
individual runs. But I definitely see the benefit of knowing those IDs
when debugging code. There are several possible ways to implement this.
We could, for instance, log the thread ID only when a new thread is
added to the thread pool, this would then allow to map the number to the
ID if needed. Or we could add a new setting to strongswan.conf, which
would allow users to configure whether the thread number or the thread
ID is used during logging (defaulting to the number). The question is
essentially whether it is required that the actual thread ID is logged
at the beginning of every line or if listing them once during startup is
@Andreas, @Martin: What are your thoughts on this?
More information about the Dev