discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSLog suggestion


From: Amr Aboelela
Subject: NSLog suggestion
Date: Fri, 20 Feb 2015 11:32:55 -0800

NSLogv(NSString* format, va_list args)

...

            /*prefix = [NSString

                      stringWithFormat: @"%@ %@[%d] ",

                      [[NSCalendarDate calendarDate]

                       descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F"],

                      [[NSProcessInfo processInfo] processName],

                      pid];*/

            prefix = [NSString

                      stringWithFormat: @"%@ %@[%d-%x] ",

                      [[NSCalendarDate calendarDate] descriptionWithCalendarFormat: @"%M:%S.%F"],

                      [[NSProcessInfo processInfo] processName],

                      pid, (unsigned int)pthread_self()];

...

}


Instead of printing today date and hour which is useless for a developer, print the current thread id:  (unsigned int)pthread_self()



--
Info about Islam: http://wikiz.info/islam


reply via email to

[Prev in Thread] Current Thread [Next in Thread]