VirtualBox

Changeset 100867 in vbox


Ignore:
Timestamp:
Aug 14, 2023 12:47:52 AM (16 months ago)
Author:
vboxsync
Message:

IPRT/log.h: Added a bunch of Log*Ex() macros that allows logging to a non-default group w/o too much hazzle. Also added LOG_FN_NAME to go along with LOG_FN_FMT. bugref:10369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/log.h

    r100672 r100867  
    151151 * You can use this to specify your desired way of printing __PRETTY_FUNCTION__
    152152 * if you dislike the default one.
     153 * @todo __PRETTY_FUNCTION__ is not optimal here.
    153154 */
    154155#ifndef LOG_FN_FMT
    155156# define LOG_FN_FMT "%Rfn"
     157#endif
     158
     159/** @def LOG_FN_NAME
     160 * Alias for __PRETTY_FUNCTION__ or similar that goes the best with LOG_FN_FMT.
     161 * @todo __PRETTY_FUNCTION__ is not optimal here.
     162 */
     163#ifndef LOG_FN_NAME
     164# define LOG_FN_NAME RT_GCC_EXTENSION __PRETTY_FUNCTION__
    156165#endif
    157166
     
    494503 *
    495504 * @remarks We only use the lower 16 bits here.  We'll be combining it with the
    496  *          group number in a few places.
     505 *          group number in a few places (e.g. RTLogDefaultInstanceEx,
     506 *          RTLogGetDefaultInstanceEx, RTLogRelGetDefaultInstanceEx, ++) where
     507 *          the high 16-bit word is used for the group number.
    497508 */
    498509typedef enum RTLOGGRPFLAGS
     
    851862 */
    852863#ifdef LOG_USE_C99
    853 # define LogFunc(a)   _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    854 #else
    855 # define LogFunc(a)   do { Log((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log(a); } while (0)
     864# define LogFunc(a)   _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     865#else
     866# define LogFunc(a)   do { Log((LOG_FN_FMT ": ", LOG_FN_NAME)); Log(a); } while (0)
    856867#endif
    857868
     
    865876 */
    866877#ifdef LOG_USE_C99
    867 # define Log2Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_2, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    868 #else
    869 # define Log2Func(a)  do { Log2((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log2(a); } while (0)
     878# define Log2Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_2, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     879#else
     880# define Log2Func(a)  do { Log2((LOG_FN_FMT ": ", LOG_FN_NAME)); Log2(a); } while (0)
    870881#endif
    871882
     
    879890 */
    880891#ifdef LOG_USE_C99
    881 # define Log3Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_3, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    882 #else
    883 # define Log3Func(a)  do { Log3((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log3(a); } while (0)
     892# define Log3Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_3, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     893#else
     894# define Log3Func(a)  do { Log3((LOG_FN_FMT ": ", LOG_FN_NAME)); Log3(a); } while (0)
    884895#endif
    885896
     
    893904 */
    894905#ifdef LOG_USE_C99
    895 # define Log4Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    896 #else
    897 # define Log4Func(a)  do { Log4((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log4(a); } while (0)
     906# define Log4Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     907#else
     908# define Log4Func(a)  do { Log4((LOG_FN_FMT ": ", LOG_FN_NAME)); Log4(a); } while (0)
    898909#endif
    899910
     
    907918 */
    908919#ifdef LOG_USE_C99
    909 # define Log5Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_5, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    910 #else
    911 # define Log5Func(a)  do { Log5((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log5(a); } while (0)
     920# define Log5Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_5, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     921#else
     922# define Log5Func(a)  do { Log5((LOG_FN_FMT ": ", LOG_FN_NAME)); Log5(a); } while (0)
    912923#endif
    913924
     
    921932 */
    922933#ifdef LOG_USE_C99
    923 # define Log6Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_6, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    924 #else
    925 # define Log6Func(a)  do { Log6((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log6(a); } while (0)
     934# define Log6Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_6, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     935#else
     936# define Log6Func(a)  do { Log6((LOG_FN_FMT ": ", LOG_FN_NAME)); Log6(a); } while (0)
    926937#endif
    927938
     
    935946 */
    936947#ifdef LOG_USE_C99
    937 # define Log7Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_7, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    938 #else
    939 # define Log7Func(a)  do { Log7((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log7(a); } while (0)
     948# define Log7Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_7, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     949#else
     950# define Log7Func(a)  do { Log7((LOG_FN_FMT ": ", LOG_FN_NAME)); Log7(a); } while (0)
    940951#endif
    941952
     
    949960 */
    950961#ifdef LOG_USE_C99
    951 # define Log8Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_8, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    952 #else
    953 # define Log8Func(a)  do { Log8((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log8(a); } while (0)
     962# define Log8Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_8, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     963#else
     964# define Log8Func(a)  do { Log8((LOG_FN_FMT ": ", LOG_FN_NAME)); Log8(a); } while (0)
    954965#endif
    955966
     
    963974 */
    964975#ifdef LOG_USE_C99
    965 # define Log9Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_9, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    966 #else
    967 # define Log9Func(a)  do { Log9((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log9(a); } while (0)
     976# define Log9Func(a)  _LogIt(RTLOGGRPFLAGS_LEVEL_9, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     977#else
     978# define Log9Func(a)  do { Log9((LOG_FN_FMT ": ", LOG_FN_NAME)); Log9(a); } while (0)
    968979#endif
    969980
     
    977988 */
    978989#ifdef LOG_USE_C99
    979 # define Log10Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_10, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    980 #else
    981 # define Log10Func(a) do { Log10((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log10(a); } while (0)
     990# define Log10Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_10, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     991#else
     992# define Log10Func(a) do { Log10((LOG_FN_FMT ": ", LOG_FN_NAME)); Log10(a); } while (0)
    982993#endif
    983994
     
    9911002 */
    9921003#ifdef LOG_USE_C99
    993 # define Log11Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_11, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    994 #else
    995 # define Log11Func(a) do { Log11((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log11(a); } while (0)
     1004# define Log11Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_11, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     1005#else
     1006# define Log11Func(a) do { Log11((LOG_FN_FMT ": ", LOG_FN_NAME)); Log11(a); } while (0)
    9961007#endif
    9971008
     
    10051016 */
    10061017#ifdef LOG_USE_C99
    1007 # define Log12Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_12, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1008 #else
    1009 # define Log12Func(a) do { Log12((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log12(a); } while (0)
     1018# define Log12Func(a) _LogIt(RTLOGGRPFLAGS_LEVEL_12, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     1019#else
     1020# define Log12Func(a) do { Log12((LOG_FN_FMT ": ", LOG_FN_NAME)); Log12(a); } while (0)
    10101021#endif
    10111022
     
    10201031#ifdef LOG_USE_C99
    10211032# define LogFlowFunc(a) \
    1022     _LogIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1033    _LogIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
    10231034#else
    10241035# define LogFlowFunc(a) \
    1025     do { LogFlow((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogFlow(a); } while (0)
     1036    do { LogFlow((LOG_FN_FMT ": ", LOG_FN_NAME)); LogFlow(a); } while (0)
    10261037#endif
    10271038
     
    10361047#ifdef LOG_USE_C99
    10371048# define LogWarnFunc(a) \
    1038     _LogIt(RTLOGGRPFLAGS_WARN, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1049    _LogIt(RTLOGGRPFLAGS_WARN, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
    10391050#else
    10401051# define LogWarnFunc(a) \
    1041     do { LogFlow((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogFlow(a); } while (0)
     1052    do { LogFlow((LOG_FN_FMT ": ", LOG_FN_NAME)); LogFlow(a); } while (0)
    10421053#endif
    10431054/** @} */
     
    10541065#ifdef LOG_USE_C99
    10551066# define LogThisFunc(a) \
    1056     _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1057 #else
    1058 # define LogThisFunc(a) do { Log(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log(a); } while (0)
     1067    _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1068#else
     1069# define LogThisFunc(a) do { Log(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log(a); } while (0)
    10591070#endif
    10601071
     
    10661077#ifdef LOG_USE_C99
    10671078# define Log2ThisFunc(a) \
    1068     _LogIt(RTLOGGRPFLAGS_LEVEL_2, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1069 #else
    1070 # define Log2ThisFunc(a) do { Log2(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log2(a); } while (0)
     1079    _LogIt(RTLOGGRPFLAGS_LEVEL_2, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1080#else
     1081# define Log2ThisFunc(a) do { Log2(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log2(a); } while (0)
    10711082#endif
    10721083
     
    10781089#ifdef LOG_USE_C99
    10791090# define Log3ThisFunc(a) \
    1080     _LogIt(RTLOGGRPFLAGS_LEVEL_3, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1081 #else
    1082 # define Log3ThisFunc(a) do { Log3(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log3(a); } while (0)
     1091    _LogIt(RTLOGGRPFLAGS_LEVEL_3, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1092#else
     1093# define Log3ThisFunc(a) do { Log3(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log3(a); } while (0)
    10831094#endif
    10841095
     
    10901101#ifdef LOG_USE_C99
    10911102# define Log4ThisFunc(a) \
    1092     _LogIt(RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1093 #else
    1094 # define Log4ThisFunc(a) do { Log4(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log4(a); } while (0)
     1103    _LogIt(RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1104#else
     1105# define Log4ThisFunc(a) do { Log4(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log4(a); } while (0)
    10951106#endif
    10961107
     
    11021113#ifdef LOG_USE_C99
    11031114# define Log5ThisFunc(a) \
    1104     _LogIt(RTLOGGRPFLAGS_LEVEL_5, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1105 #else
    1106 # define Log5ThisFunc(a) do { Log5(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log5(a); } while (0)
     1115    _LogIt(RTLOGGRPFLAGS_LEVEL_5, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1116#else
     1117# define Log5ThisFunc(a) do { Log5(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log5(a); } while (0)
    11071118#endif
    11081119
     
    11141125#ifdef LOG_USE_C99
    11151126# define Log6ThisFunc(a) \
    1116     _LogIt(RTLOGGRPFLAGS_LEVEL_6, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1117 #else
    1118 # define Log6ThisFunc(a) do { Log6(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log6(a); } while (0)
     1127    _LogIt(RTLOGGRPFLAGS_LEVEL_6, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1128#else
     1129# define Log6ThisFunc(a) do { Log6(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log6(a); } while (0)
    11191130#endif
    11201131
     
    11261137#ifdef LOG_USE_C99
    11271138# define Log7ThisFunc(a) \
    1128     _LogIt(RTLOGGRPFLAGS_LEVEL_7, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1129 #else
    1130 # define Log7ThisFunc(a) do { Log7(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log7(a); } while (0)
     1139    _LogIt(RTLOGGRPFLAGS_LEVEL_7, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1140#else
     1141# define Log7ThisFunc(a) do { Log7(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log7(a); } while (0)
    11311142#endif
    11321143
     
    11381149#ifdef LOG_USE_C99
    11391150# define Log8ThisFunc(a) \
    1140     _LogIt(RTLOGGRPFLAGS_LEVEL_8, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1141 #else
    1142 # define Log8ThisFunc(a) do { Log8(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log8(a); } while (0)
     1151    _LogIt(RTLOGGRPFLAGS_LEVEL_8, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1152#else
     1153# define Log8ThisFunc(a) do { Log8(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log8(a); } while (0)
    11431154#endif
    11441155
     
    11501161#ifdef LOG_USE_C99
    11511162# define Log9ThisFunc(a) \
    1152     _LogIt(RTLOGGRPFLAGS_LEVEL_9, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1153 #else
    1154 # define Log9ThisFunc(a) do { Log9(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log9(a); } while (0)
     1163    _LogIt(RTLOGGRPFLAGS_LEVEL_9, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1164#else
     1165# define Log9ThisFunc(a) do { Log9(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log9(a); } while (0)
    11551166#endif
    11561167
     
    11621173#ifdef LOG_USE_C99
    11631174# define Log10ThisFunc(a) \
    1164     _LogIt(RTLOGGRPFLAGS_LEVEL_10, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1165 #else
    1166 # define Log10ThisFunc(a) do { Log10(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log10(a); } while (0)
     1175    _LogIt(RTLOGGRPFLAGS_LEVEL_10, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1176#else
     1177# define Log10ThisFunc(a) do { Log10(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log10(a); } while (0)
    11671178#endif
    11681179
     
    11741185#ifdef LOG_USE_C99
    11751186# define Log11ThisFunc(a) \
    1176     _LogIt(RTLOGGRPFLAGS_LEVEL_11, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1177 #else
    1178 # define Log11ThisFunc(a) do { Log11(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log11(a); } while (0)
     1187    _LogIt(RTLOGGRPFLAGS_LEVEL_11, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1188#else
     1189# define Log11ThisFunc(a) do { Log11(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log11(a); } while (0)
    11791190#endif
    11801191
     
    11861197#ifdef LOG_USE_C99
    11871198# define Log12ThisFunc(a) \
    1188     _LogIt(RTLOGGRPFLAGS_LEVEL_12, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1189 #else
    1190 # define Log12ThisFunc(a) do { Log12(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log12(a); } while (0)
     1199    _LogIt(RTLOGGRPFLAGS_LEVEL_12, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1200#else
     1201# define Log12ThisFunc(a) do { Log12(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); Log12(a); } while (0)
    11911202#endif
    11921203
     
    11981209#ifdef LOG_USE_C99
    11991210# define LogFlowThisFunc(a) \
    1200     _LogIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1201 #else
    1202 # define LogFlowThisFunc(a) do { LogFlow(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogFlow(a); } while (0)
     1211    _LogIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1212#else
     1213# define LogFlowThisFunc(a) do { LogFlow(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); LogFlow(a); } while (0)
    12031214#endif
    12041215
     
    12101221#ifdef LOG_USE_C99
    12111222# define LogWarnThisFunc(a) \
    1212     _LogIt(RTLOGGRPFLAGS_WARN, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1213 #else
    1214 # define LogWarnThisFunc(a) do { LogWarn(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogWarn(a); } while (0)
     1223    _LogIt(RTLOGGRPFLAGS_WARN, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1224#else
     1225# define LogWarnThisFunc(a) do { LogWarn(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); LogWarn(a); } while (0)
    12151226#endif
    12161227/** @} */
     
    12381249#ifdef LOG_USE_C99
    12391250# define Log1WarningFunc(a) \
    1240     _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": WARNING! %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1251    _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": WARNING! %M", LOG_FN_NAME, _LogRemoveParentheseis a )
    12411252#else
    12421253# define Log1WarningFunc(a) \
    1243     do { Log((LOG_FN_FMT ": WARNING! ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log(a); } while (0)
     1254    do { Log((LOG_FN_FMT ": WARNING! ", LOG_FN_NAME)); Log(a); } while (0)
    12441255#endif
    12451256
     
    12521263#ifdef LOG_USE_C99
    12531264# define Log1WarningThisFunc(a) \
    1254     _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": WARNING! %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1265    _LogIt(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": WARNING! %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
    12551266#else
    12561267# define Log1WarningThisFunc(a) \
    1257     do { Log(("{%p} " LOG_FN_FMT ": WARNING! ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); Log(a); } while (0)
     1268    do { Log(("{%p} " LOG_FN_FMT ": WARNING! ", this, LOG_FN_NAME)); Log(a); } while (0)
    12581269#endif
    12591270
     
    12951306
    12961307
     1308/** @name Logging to specific group.
     1309 * @{ */
     1310/** @def LogEx
     1311 * Level 1 logging to specific group.
     1312 */
     1313#define LogEx(a_Grp, a)         LogIt(RTLOGGRPFLAGS_LEVEL_1, a_Grp, a)
     1314
     1315/** @def Log2Ex
     1316 * Level 2 logging to specific group.
     1317 */
     1318#define Log2Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_2,  a_Grp, a)
     1319
     1320/** @def Log3Ex
     1321 * Level 3 logging to specific group.
     1322 */
     1323#define Log3Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_3,  a_Grp, a)
     1324
     1325/** @def Log4Ex
     1326 * Level 4 logging to specific group.
     1327 */
     1328#define Log4Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_4,  a_Grp, a)
     1329
     1330/** @def Log5Ex
     1331 * Level 5 logging to specific group.
     1332 */
     1333#define Log5Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_5,  a_Grp, a)
     1334
     1335/** @def Log6Ex
     1336 * Level 6 logging to specific group.
     1337 */
     1338#define Log6Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_6,  a_Grp, a)
     1339
     1340/** @def Log7Ex
     1341 * Level 7 logging to specific group.
     1342 */
     1343#define Log7Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_7,  a_Grp, a)
     1344
     1345/** @def Log8Ex
     1346 * Level 8 logging to specific group.
     1347 */
     1348#define Log8Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_8,  a_Grp, a)
     1349
     1350/** @def Log9Ex
     1351 * Level 9 logging to specific group.
     1352 */
     1353#define Log9Ex(a_Grp, a)        LogIt(RTLOGGRPFLAGS_LEVEL_9,  a_Grp, a)
     1354
     1355/** @def Log10Ex
     1356 * Level 10 logging to specific group.
     1357 */
     1358#define Log10Ex(a_Grp, a)       LogIt(RTLOGGRPFLAGS_LEVEL_10, a_Grp, a)
     1359
     1360/** @def Log11Ex
     1361 * Level 11 logging to specific group.
     1362 */
     1363#define Log11Ex(a_Grp, a)       LogIt(RTLOGGRPFLAGS_LEVEL_11, a_Grp, a)
     1364
     1365/** @def Log12Ex
     1366 * Level 12 logging to specific group.
     1367 */
     1368#define Log12Ex(a_Grp, a)       LogIt(RTLOGGRPFLAGS_LEVEL_12,  a_Grp, a)
     1369
     1370/** @def LogFlowEx
     1371 * Logging of execution flow to specific group.
     1372 */
     1373#define LogFlowEx(a_Grp, a)     LogIt(RTLOGGRPFLAGS_FLOW,      a_Grp, a)
     1374
     1375/** @def LogWarnEx
     1376 * Logging of warnings to specific group.
     1377 */
     1378#define LogWarnEx(a_Grp, a)     LogIt(RTLOGGRPFLAGS_WARN,      a_Grp, a)
     1379/** @} */
     1380
    12971381
    12981382/** @name Passing Function Call Position When Logging.
     
    13051389/** Source position for passing to a function call. */
    13061390#ifdef LOG_ENABLED
    1307 # define RTLOG_COMMA_SRC_POS        , __FILE__, __LINE__, RT_GCC_EXTENSION __PRETTY_FUNCTION__
     1391# define RTLOG_COMMA_SRC_POS        , __FILE__, __LINE__, LOG_FN_NAME
    13081392#else
    13091393# define RTLOG_COMMA_SRC_POS        RT_NOTHING
     
    16981782#ifdef LOG_USE_C99
    16991783# define LogRelFunc(a) \
    1700     _LogRelItLikely(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1701 #else
    1702 # define LogRelFunc(a)      do { LogRel((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRel(a); } while (0)
     1784    _LogRelItLikely(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     1785#else
     1786# define LogRelFunc(a)      do { LogRel((LOG_FN_FMT ": ", LOG_FN_NAME)); LogRel(a); } while (0)
    17031787#endif
    17041788
     
    17121796 */
    17131797#ifdef LOG_USE_C99
    1714 # define LogRelFlowFunc(a)  _LogRelIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1715 #else
    1716 # define LogRelFlowFunc(a)  do { LogRelFlow((LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRelFlow(a); } while (0)
     1798# define LogRelFlowFunc(a)  _LogRelIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
     1799#else
     1800# define LogRelFlowFunc(a)  do { LogRelFlow((LOG_FN_FMT ": ", LOG_FN_NAME)); LogRelFlow(a); } while (0)
    17171801#endif
    17181802
     
    17231807#ifdef LOG_USE_C99
    17241808# define LogRelMaxFunc(a_cMax, a) \
    1725     _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1809    _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
    17261810#else
    17271811# define LogRelMaxFunc(a_cMax, a) \
    1728     do { LogRelMax(a_cMax, (LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRelMax(a_cMax, a); } while (0)
     1812    do { LogRelMax(a_cMax, (LOG_FN_FMT ": ", LOG_FN_NAME)); LogRelMax(a_cMax, a); } while (0)
    17291813#endif
    17301814
     
    17401824#ifdef LOG_USE_C99
    17411825# define LogRelMaxFlowFunc(a_cMax, a) \
    1742     _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1826    _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_FLOW, LOG_GROUP, LOG_FN_FMT ": %M", LOG_FN_NAME, _LogRemoveParentheseis a )
    17431827#else
    17441828# define LogRelMaxFlowFunc(a_cMax, a) \
    1745     do { LogRelMaxFlow(a_cMax, (LOG_FN_FMT ": ", RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRelFlow(a_cMax, a); } while (0)
     1829    do { LogRelMaxFlow(a_cMax, (LOG_FN_FMT ": ", LOG_FN_NAME)); LogRelFlow(a_cMax, a); } while (0)
    17461830#endif
    17471831
     
    17581842#ifdef LOG_USE_C99
    17591843# define LogRelThisFunc(a) \
    1760     _LogRelItLikely(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1844    _LogRelItLikely(RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
    17611845#else
    17621846# define LogRelThisFunc(a) \
    1763     do { LogRel(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRel(a); } while (0)
     1847    do { LogRel(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); LogRel(a); } while (0)
    17641848#endif
    17651849
     
    17721856#ifdef LOG_USE_C99
    17731857# define LogRelMaxThisFunc(a_cMax, a) \
    1774     _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1858    _LogRelMaxIt(a_cMax, RTLOGGRPFLAGS_LEVEL_1, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
    17751859#else
    17761860# define LogRelMaxThisFunc(a_cMax, a) \
    1777     do { LogRelMax(a_cMax, ("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRelMax(a_cMax, a); } while (0)
     1861    do { LogRelMax(a_cMax, ("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); LogRelMax(a_cMax, a); } while (0)
    17781862#endif
    17791863
     
    17841868#ifdef LOG_USE_C99
    17851869# define LogRelFlowThisFunc(a) \
    1786     _LogRelIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
    1787 #else
    1788 # define LogRelFlowThisFunc(a) do { LogRelFlow(("{%p} " LOG_FN_FMT ": ", this, RT_GCC_EXTENSION __PRETTY_FUNCTION__)); LogRelFlow(a); } while (0)
     1870    _LogRelIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, LOG_FN_NAME, _LogRemoveParentheseis a )
     1871#else
     1872# define LogRelFlowThisFunc(a) do { LogRelFlow(("{%p} " LOG_FN_FMT ": ", this, LOG_FN_NAME)); LogRelFlow(a); } while (0)
    17891873#endif
    17901874
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette