On 2012.05.08 11:08, Xiaofan Chen wrote: >>> Sean, maybe it would be an idea for the os dependent code to print a >>> thread "name" + id when creating a thread and debugging is enabled, >>> this way a user can easily find which thread-id is which thread >>> in the logs? >>> >> >> Maybe this is a good idea.
On that subject, I've been wondering whether it may be worth exposing a call for user logging into our API, such as libusb_log(format, ...) or libusb_log(level, format, ...). This could be used by user applications to send custom messages to the libusbx logging facility. With regards to the above, one could for instance send the output of pthread_getname_np(), or any other indicator, and get it automatically associated with the libusbx thread ID in the log output. Before we had timestamps and threadID, the use of such a call would have been fairly limited, as one could just issue an fprintf() in their app. But now that we have them, something dedicated may be more useful. We also had another long discussion in libusb, more than a year ago, about a logging callback (which, eventually, we probably want to pick up in libusbx), but if my fuzzy memory of it serves me well, this was more about redirecting the log output than log input. Regards, /Pete ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel