diff options
author | Marco Zuehlke <andruil@users.sourceforge.net> | 2003-06-20 20:57:28 +0000 |
---|---|---|
committer | Marco Zuehlke <andruil@users.sourceforge.net> | 2003-06-20 20:57:28 +0000 |
commit | c42d9377589180f6d40ce61f9c317aa678b8ab14 (patch) | |
tree | 45bff64663affb79f285ccdd797b95c277ad30c1 /src/xine-utils/xineutils.h | |
parent | 17013809abbfd9789f314106203d1c5eaf7f4ba7 (diff) | |
download | xine-lib-c42d9377589180f6d40ce61f9c317aa678b8ab14.tar.gz xine-lib-c42d9377589180f6d40ce61f9c317aa678b8ab14.tar.bz2 |
the new logging macros, for details see README.logging
CVS patchset: 5077
CVS date: 2003/06/20 20:57:28
Diffstat (limited to 'src/xine-utils/xineutils.h')
-rw-r--r-- | src/xine-utils/xineutils.h | 78 |
1 files changed, 75 insertions, 3 deletions
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 337c12a8e..a53dddca4 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2000-2002 the xine project +/* + * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. * @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.53 2003/06/13 23:05:35 komadori Exp $ + * $Id: xineutils.h,v 1.54 2003/06/20 20:57:29 andruil Exp $ * */ #ifndef XINEUTILS_H @@ -881,6 +881,78 @@ void xine_print_trace(void); #endif +/****** logging with xine **********************************/ + +#ifndef LOG_MODULE + #define LOG_MODULE __FILE__ +#endif /* LOG_MODULE */ + +#define LOG_MODULE_STRING printf("%s: ", LOG_MODULE ); + +#ifdef LOG_VERBOSE + #define LONG_LOG_MODULE_STRING \ + printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ ); +#else + #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING +#endif /* LOG_VERBOSE */ + +#ifdef LOG + #ifdef __GNUC__ + #define lprintf(fmt, args...) \ + do{ \ + LONG_LOG_MODULE_STRING \ + printf( fmt, ##args ); \ + }while(0) + #else + #define lprintf(fmt, ...) \ + do{ \ + LONG_LOG_MODULE_STRING \ + printf( fmt, __VA_ARGS__ ); \ + }while(0) + #endif /* __GNUC__ */ +#else + #ifdef __GNUC__ + #define lprintf(fmt, args...) ; + #else + #define lprintf(fmt, ...) ; + #endif /* __GNUC__ */ +#endif /* LOG */ + +#ifdef __GNUC__ + #define llprintf(cat, fmt, args...) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( fmt, ##args ); \ + } \ + }while(0) +#else + #define llprintf(cat, fmt, ...) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( fmt, __VA_ARGS__ ); \ + } \ + }while(0) +#endif /* __GNUC__ */ + +#ifdef __GNUC__ + #define xprintf(xine, verbose, fmt, args...) \ + do { \ + if((xine)->verbosity >= verbose){ \ + LOG_MODULE_STRING \ + printf(fmt, ##args); \ + } \ + } while(0) +#else + #define xprintf(xine, verbose, fmt, ...) \ + do { \ + if((xine)->verbosity >= verbose){ \ + LOG_MODULE_STRING \ + printf(fmt, __VA_ARGS__); \ + } \ + } while(0) +#endif /* __GNUC__ */ /******** double chained lists with builtin iterator *******/ |