You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ig...@apache.org on 2013/08/08 19:47:03 UTC
[08/15] git commit: Rename prefix to TSLog, add warning about usage
Rename prefix to TSLog, add warning about usage
these APIs are still "internal" until we figure out a better way of
presenting them to the outside world.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/872afee0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/872afee0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/872afee0
Branch: refs/heads/consistent-gzip-error-msgs
Commit: 872afee05bc8dadbe754bd2440aff44e0c887d69
Parents: c91e1c1
Author: Igor Galić <i....@brainsware.org>
Authored: Thu Aug 8 17:21:46 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Thu Aug 8 19:39:03 2013 +0200
----------------------------------------------------------------------
proxy/api/ts/ts-debug.h | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/872afee0/proxy/api/ts/ts-debug.h
----------------------------------------------------------------------
diff --git a/proxy/api/ts/ts-debug.h b/proxy/api/ts/ts-debug.h
index dc1abda..e5a4f9d 100644
--- a/proxy/api/ts/ts-debug.h
+++ b/proxy/api/ts/ts-debug.h
@@ -31,31 +31,36 @@
/** all of these APIs assume you've defined PLUGIN_NAME first before
* including this header file.
+ *
+ * These APIs are private, that is: They are not installed. They
+ * can be used by in-tree plugins, external plugins will have to redefine this
+ * or find their own way of logging, until ATS has unified it's plugin logging
+ * in the same way it has unified the core-logging.
**/
#ifndef PLUGIN_NAME
-# error "A plugin must define a PLUGIN_NAME string constant *before* including <ts/ts.h> in order to use TSPlugin(Debug|Info|Warning|Error|Fatal)"
+# error "A plugin must define a PLUGIN_NAME string constant *before* including <ts/ts.h> in order to use TSLog(Debug|Info|Warning|Error|Fatal)"
#else
-#define TSPluginDebug(fmt, args...) do { \
+#define TSLogDebug(fmt, args...) do { \
TSDebug(PLUGIN_NAME, "DEBUG: [%s:%d] [%s] " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \
} while (0)
-#define TSPluginInfo(fmt, args...) do { \
+#define TSLogInfo(fmt, args...) do { \
TSDebug(PLUGIN_NAME, "INFO: " fmt, ##args ); \
} while (0)
-#define TSPluginWarning(fmt, args...) do { \
+#define TSLogWarning(fmt, args...) do { \
TSDebug(PLUGIN_NAME, "WARNING: " fmt, ##args ); \
} while (0)
-#define TSPluginError(fmt, args...) do { \
+#define TSLogError(fmt, args...) do { \
TSError("[%s] [%s:%d] [%s] ERROR: " fmt, PLUGIN_NAME, __FILE__, __LINE__, __FUNCTION__ , ##args ); \
TSDebug(PLUGIN_NAME, "[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \
} while (0)
#endif
-#define TSPluginFatal(fmt, args...) do { \
+#define TSLogFatal(fmt, args...) do { \
TSError("[%s] [%s:%d] [%s] FATAL: " fmt, PLUGIN_NAME, __FILE__, __LINE__, __FUNCTION__ , ##args ); \
TSDebug(PLUGIN_NAME, "[%s:%d] [%s] FATAL: " fmt, __FILE__, __LINE__, __FUNCTION__ , ##args ); \
exit(-1); \