Re: [PATCH v7 11/16] trace: add 'file:line' to all trace output
- From
Karsten Blees <karsten.blees@gmail.com>
- Date
- Jul 2, 2014, 19:05 UTC
- Message-ID
- <53B45810.9000806@gmail.com>
- In-Reply-To
- <xmqqionfh9lp.fsf@gitster.dls.corp.google.com>
Am 02.07.2014 20:57, schrieb Junio C Hamano:
Show 17 quoted lines
> Karsten Blees <karsten.blees@gmail.com> writes: > >> +#else >> + >> +/* >> + * Macros to add file:line - see above for C-style declarations of how these >> + * should be used. >> + * >> + * TRACE_CONTEXT may be set to __FUNCTION__ if the compiler supports it. The >> + * default is __FILE__, as it is consistent with assert(), and static function >> + * names are not necessarily unique. >> + */ >> +#define TRACE_CONTEXT __FILE__ > > Hmph, seeing "may be set to" forces me to wonder how. Perhaps #ifndef/#endif > around it? >
Right, shame on me. I didn't think it would be important enough to warrant a Makefile option, but #ifndef sure wouldn't hurt.
> Also, can it be set to something like __FILE__ ":" __FUNCTION__ > which may alleviate the alleged problem of "not necessarily unique" > perhaps? >
Should work with MSVC. With GCC, however, __FUNCTION__ is a string constant supplied by the compiler, so string literal concatenation doesn't work.
-- -- *** Please reply-to-all at all times *** *** (do not pretend to know who is subscribed and who is not) *** *** Please avoid top-posting. *** The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free. You received this message because you are subscribed to the Google Groups "msysGit" group. To post to this group, send email to msysgit@googlegroups.com To unsubscribe from this group, send email to msysgit+unsubscribe@googlegroups.com For more options, and view previous threads, visit this group at http://groups.google.com/group/msysgit?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "msysGit" group. To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.