diff options
Diffstat (limited to 'include/iprt/log.h')
-rw-r--r-- | include/iprt/log.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/iprt/log.h b/include/iprt/log.h index cce17079..427eebc8 100644 --- a/include/iprt/log.h +++ b/include/iprt/log.h @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2006-2011 Oracle Corporation + * Copyright (C) 2006-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -705,6 +705,22 @@ RTDECL(void) RTLogPrintfEx(void *pvInstance, unsigned fFlags, unsigned iGroup, c do { Log((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log(a); } while (0) #endif +/** @def Log4Func + * Level 4 logging inside C/C++ functions. + * + * Prepends the given log message with the function name followed by a + * semicolon and space. + * + * @param a Log message in format <tt>("string\n" [, args])</tt>. + */ +#ifdef LOG_USE_C99 +# define Log4Func(a) \ + _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a ) +#else +# define Log4Func(a) \ + do { Log((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log(a); } while (0) +#endif + /** @def LogThisFunc * The same as LogFunc but for class functions (methods): the resulting log * line is additionally prepended with a hex value of |this| pointer. |