steal "api" from gzip plugin
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4c57a1f3 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4c57a1f3 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4c57a1f3 Branch: refs/heads/consistent-gzip-error-msgs Commit: 4c57a1f3b599ab13700a025bc997ac247b6044c4 Parents: c8725ba Author: Igor GaliÄ <[email protected]> Authored: Thu Aug 8 15:58:43 2013 +0200 Committer: Igor GaliÄ <[email protected]> Committed: Thu Aug 8 19:39:03 2013 +0200 ---------------------------------------------------------------------- plugins/gzip/debug_macros.h | 27 ++------------------------- proxy/api/ts/ts.h.in | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4c57a1f3/plugins/gzip/debug_macros.h ---------------------------------------------------------------------- diff --git a/plugins/gzip/debug_macros.h b/plugins/gzip/debug_macros.h index 151de31..858d749 100644 --- a/plugins/gzip/debug_macros.h +++ b/plugins/gzip/debug_macros.h @@ -24,32 +24,9 @@ #ifndef _DBG_MACROS_H #define _DBG_MACROS_H -#include <ts/ts.h> - -#define TAG "gzip" - -#define debug(fmt, args...) do { \ - TSDebug(TAG, "DEBUG: [%s:%d] [%s] " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ - } while (0) - -#define info(fmt, args...) do { \ - TSDebug(TAG, "INFO: " fmt, ##args ); \ - } while (0) +#define PLUGIN_NAME "gzip" -#define warning(fmt, args...) do { \ - TSDebug(TAG, "WARNING: " fmt, ##args ); \ -} while (0) - -#define error(fmt, args...) do { \ - TSError("[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ - TSDebug(TAG, "[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ -} while (0) - -#define fatal(fmt, args...) do { \ - TSError("[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ - TSDebug(TAG, "[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ - exit(-1); \ -} while (0) +#include <ts/ts.h> //FIXME: this one doesn't deserve to be here #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4c57a1f3/proxy/api/ts/ts.h.in ---------------------------------------------------------------------- diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in index 3379a26..7bd2453 100644 --- a/proxy/api/ts/ts.h.in +++ b/proxy/api/ts/ts.h.in @@ -1300,6 +1300,29 @@ extern "C" */ tsapi void TSError(const char* fmt, ...) TS_PRINTFLIKE(1, 2); +#define TSPluginDebug(fmt, args...) do { \ + TSDebug(PLUGIN_NAME, "DEBUG: [%s:%d] [%s] " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ + } while (0) + +#define TSPluginInfo(fmt, args...) do { \ + TSDebugSpecific(PLUGIN_NAME, "INFO: " fmt, ##args ); \ + } while (0) + +#define TSPluginWarning(fmt, args...) do { \ + TSDebugSpecific(PLUGIN_NAME, "WARNING: " fmt, ##args ); \ +} while (0) + +#define TSPluginError(fmt, args...) do { \ + TSError("[%s] [%s:%d] [%s] ERROR: " fmt, PLUGIN_NAME, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ + TSDebugSpecific(PLUGIN_NAME, "[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ +} while (0) + +#define TSPluginFatal(fmt, args...) do { \ + TSError("[%s] [%s:%d] [%s] FATAL: " fmt, PLUGIN_NAME, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ + TSDebugSpecific(PLUGIN_NAME, "[%s:%d] [%s] FATAL: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \ + exit(-1); \ +} while (0) + /* -------------------------------------------------------------------------- Assertions */ tsapi void _TSReleaseAssert(const char* txt, const char* f, int l) TS_NORETURN;
