trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: TS-4976: Regularize plugins - version
Date Mon, 18 Sep 2017 19:47:58 GMT
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new db04b03  TS-4976: Regularize plugins - version
db04b03 is described below

commit db04b03a1cf8cb66ec09ae358cf520c3008d5085
Author: Alan M. Carroll <amc@apache.org>
AuthorDate: Thu Sep 14 13:00:31 2017 -0500

    TS-4976: Regularize plugins - version
---
 example/version/version.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/example/version/version.c b/example/version/version.c
index 1b82ca9..525c241 100644
--- a/example/version/version.c
+++ b/example/version/version.c
@@ -1,6 +1,6 @@
 /** @file
 
-  an example plugin showing off how to use versioning
+  An example plugin showing off how to use versioning.
 
   @section license License
 
@@ -24,6 +24,8 @@
 #include <stdio.h>
 #include <ts/ts.h>
 
+#define PLUGIN_NAME "version"
+
 void
 TSPluginInit(int argc, const char *argv[])
 {
@@ -33,7 +35,7 @@ TSPluginInit(int argc, const char *argv[])
   // Get the version:
   const char *ts_version = TSTrafficServerVersionGet();
   if (!ts_version) {
-    TSError("[version] Can't get Traffic Server verion.\n");
+    TSError("[%s] Can't get Traffic Server verion.", PLUGIN_NAME);
     return;
   }
 
@@ -43,14 +45,14 @@ TSPluginInit(int argc, const char *argv[])
   int patch_ts_version = 0;
 
   if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, &patch_ts_version)
!= 3) {
-    TSError("[version] Can't extract verions.\n");
+    TSError("[%s] Can't extract verions.", PLUGIN_NAME);
     return;
   }
 
   TSPluginRegistrationInfo info;
-  info.plugin_name   = "version-plugin";
-  info.vendor_name   = "MyCompany";
-  info.support_email = "ts-api-support@MyCompany.com";
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "dev@trafficserver.apache.org";
 
 // partial compilation
 #if (TS_VERSION_NUMBER < 3000000)
@@ -60,9 +62,8 @@ TSPluginInit(int argc, const char *argv[])
 #else
   if (TSPluginRegister(&info) != TS_SUCCESS) {
 #endif
-    TSError("[version] Plugin registration failed. \n");
+    TSError("[%s] Plugin registration failed.", PLUGIN_NAME);
   }
 
-  TSDebug("debug-version-plugin", "Running in Apache Traffic Server: v%d.%d.%d", major_ts_version,
minor_ts_version,
-          patch_ts_version);
+  TSDebug(PLUGIN_NAME, "Running in Apache Traffic Server: v%d.%d.%d", major_ts_version, minor_ts_version,
patch_ts_version);
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message