VirtualBox

Changeset 8480

Show
Ignore:
Timestamp:
04/29/08 22:33:48 (9 months ago)
Author:
vboxsync
Message:

Use %Rfn when printing PRETTY_FUNCTION. Can be overridden.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/log.h

    r8274 r8480  
    139139#endif 
    140140 
     141/** @def LOG_FN_FMT 
     142 * You can use this to specify you desired way of printing __PRETTY_FUNCTION__ 
     143 * if you dislike the default one. 
     144 */ 
     145#ifndef LOG_FN_FMT 
     146# define LOG_FN_FMT "%Rfn" 
     147#endif 
    141148 
    142149/** Logger structure. */ 
     
    535542 */ 
    536543#define LogTrace() \ 
    537     LogFlow((">>>>> %s (%d): %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__)) 
     544    LogFlow((">>>>> %s (%d): " LOG_FN_FMT "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__)) 
    538545 
    539546/** @def LogTraceMsg 
     
    555562 */ 
    556563#define LogFunc(m) \ 
    557     do { Log(("%s: ", __PRETTY_FUNCTION__)); Log(m); } while (0) 
     564    do { Log((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log(m); } while (0) 
    558565 
    559566/** @def LogThisFunc 
     
    565572 */ 
    566573#define LogThisFunc(m) \ 
    567     do { Log(("{%p} %s: ", this, __PRETTY_FUNCTION__)); Log(m); } while (0) 
     574    do { Log(("{%p} " LOG_FN_FMT ": ", this, __PRETTY_FUNCTION__)); Log(m); } while (0) 
    568575 
    569576/** @def LogFlowFunc 
     
    576583 */ 
    577584#define LogFlowFunc(m) \ 
    578     do { LogFlow(("%s: ", __PRETTY_FUNCTION__)); LogFlow(m); } while (0) 
     585    do { LogFlow((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); LogFlow(m); } while (0) 
    579586 
    580587/** @def LogWarningFunc 
     
    585592 */ 
    586593#define LogWarningFunc(m) \ 
    587     do { Log(("%s: WARNING! ", __PRETTY_FUNCTION__)); Log(m); } while (0) 
     594    do { Log((LOG_FN_FMT ": WARNING! ", __PRETTY_FUNCTION__)); Log(m); } while (0) 
    588595 
    589596/** @def LogFlowThisFunc 
     
    595602 */ 
    596603#define LogFlowThisFunc(m) \ 
    597     do { LogFlow(("{%p} %s: ", this, __PRETTY_FUNCTION__)); LogFlow(m); } while (0) 
     604    do { LogFlow(("{%p} " LOG_FN_FMT ": ", this, __PRETTY_FUNCTION__)); LogFlow(m); } while (0) 
    598605 
    599606/** @def LogWarningThisFunc 
     
    605612 */ 
    606613#define LogWarningThisFunc(m) \ 
    607     do { Log(("{%p} %s: WARNING! ", this, __PRETTY_FUNCTION__)); Log(m); } while (0) 
     614    do { Log(("{%p} " LOG_FN_FMT ": WARNING! ", this, __PRETTY_FUNCTION__)); Log(m); } while (0) 
    608615 
    609616/** Shortcut to |LogFlowFunc ("ENTER\n")|, marks the beginnig of the function */ 
     
    781788 */ 
    782789#define LogRelFunc(a) \ 
    783     do { LogRel(("%s: ", __PRETTY_FUNCTION__)); LogRel(a); } while (0) 
     790    do { LogRel((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); LogRel(a); } while (0) 
    784791 
    785792/** @def LogRelThisFunc 
     
    788795 */ 
    789796#define LogRelThisFunc(a) \ 
    790     do { LogRel(("{%p} %s: ", this, __PRETTY_FUNCTION__)); LogRel(a); } while (0) 
     797    do { LogRel(("{%p} " LOG_FN_FMT ": ", this, __PRETTY_FUNCTION__)); LogRel(a); } while (0) 
    791798 
    792799/** @def LogRelLelik 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy