Commit 5aa561c5 authored by Michael Smith's avatar Michael Smith
Browse files

Modified version of patch from gtgbr@gmx.net to clean up headers and defines

for logging.

svn path=/icecast/trunk/icecast/; revision=10618
parent daf771db
...@@ -30,33 +30,30 @@ extern int playlistlog; ...@@ -30,33 +30,30 @@ extern int playlistlog;
*/ */
#ifdef _WIN32 #ifdef _WIN32
#define __FUNCTION__ strrchr (__FILE__, '\\') ? strrchr (__FILE__, '\\') + 1 : __FILE__ #include <string.h>
#define __func__ strrchr (__FILE__, '\\') ? strrchr (__FILE__, '\\') + 1 : __FILE__
#endif #endif
#ifdef __SUNPRO_C #define ERROR0(y) log_write(errorlog, 1, CATMODULE "/", __func__, y)
#define __FUNCTION__ __func__ #define ERROR1(y, a) log_write(errorlog, 1, CATMODULE "/", __func__, y, a)
#endif #define ERROR2(y, a, b) log_write(errorlog, 1, CATMODULE "/", __func__, y, a, b)
#define ERROR3(y, a, b, c) log_write(errorlog, 1, CATMODULE "/", __func__, y, a, b, c)
#define ERROR0(y) log_write(errorlog, 1, CATMODULE "/", __FUNCTION__, y)
#define ERROR1(y, a) log_write(errorlog, 1, CATMODULE "/", __FUNCTION__, y, a) #define WARN0(y) log_write(errorlog, 2, CATMODULE "/", __func__, y)
#define ERROR2(y, a, b) log_write(errorlog, 1, CATMODULE "/", __FUNCTION__, y, a, b) #define WARN1(y, a) log_write(errorlog, 2, CATMODULE "/", __func__, y, a)
#define ERROR3(y, a, b, c) log_write(errorlog, 1, CATMODULE "/", __FUNCTION__, y, a, b, c) #define WARN2(y, a, b) log_write(errorlog, 2, CATMODULE "/", __func__, y, a, b)
#define WARN3(y, a, b, c) log_write(errorlog, 2, CATMODULE "/", __func__, y, a, b, c)
#define WARN0(y) log_write(errorlog, 2, CATMODULE "/", __FUNCTION__, y)
#define WARN1(y, a) log_write(errorlog, 2, CATMODULE "/", __FUNCTION__, y, a) #define INFO0(y) log_write(errorlog, 3, CATMODULE "/", __func__, y)
#define WARN2(y, a, b) log_write(errorlog, 2, CATMODULE "/", __FUNCTION__, y, a, b) #define INFO1(y, a) log_write(errorlog, 3, CATMODULE "/", __func__, y, a)
#define WARN3(y, a, b, c) log_write(errorlog, 2, CATMODULE "/", __FUNCTION__, y, a, b, c) #define INFO2(y, a, b) log_write(errorlog, 3, CATMODULE "/", __func__, y, a, b)
#define INFO3(y, a, b, c) log_write(errorlog, 3, CATMODULE "/", __func__, y, a, b, c)
#define INFO0(y) log_write(errorlog, 3, CATMODULE "/", __FUNCTION__, y)
#define INFO1(y, a) log_write(errorlog, 3, CATMODULE "/", __FUNCTION__, y, a) #define DEBUG0(y) log_write(errorlog, 4, CATMODULE "/", __func__, y)
#define INFO2(y, a, b) log_write(errorlog, 3, CATMODULE "/", __FUNCTION__, y, a, b) #define DEBUG1(y, a) log_write(errorlog, 4, CATMODULE "/", __func__, y, a)
#define INFO3(y, a, b, c) log_write(errorlog, 3, CATMODULE "/", __FUNCTION__, y, a, b, c) #define DEBUG2(y, a, b) log_write(errorlog, 4, CATMODULE "/", __func__, y, a, b)
#define DEBUG3(y, a, b, c) log_write(errorlog, 4, CATMODULE "/", __func__, y, a, b, c)
#define DEBUG0(y) log_write(errorlog, 4, CATMODULE "/", __FUNCTION__, y) #define DEBUG4(y, a, b, c, d) log_write(errorlog, 4, CATMODULE "/", __func__, y, a, b, c, d)
#define DEBUG1(y, a) log_write(errorlog, 4, CATMODULE "/", __FUNCTION__, y, a)
#define DEBUG2(y, a, b) log_write(errorlog, 4, CATMODULE "/", __FUNCTION__, y, a, b)
#define DEBUG3(y, a, b, c) log_write(errorlog, 4, CATMODULE "/", __FUNCTION__, y, a, b, c)
#define DEBUG4(y, a, b, c, d) log_write(errorlog, 4, CATMODULE "/", __FUNCTION__, y, a, b, c, d)
/* CATMODULE is the category or module that logging messages come from. /* CATMODULE is the category or module that logging messages come from.
** we set one here in cause someone forgets in the .c file. ** we set one here in cause someone forgets in the .c file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment