You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/08/31 18:20:48 UTC

[trafficserver] branch master updated (0ade4d7 -> 5063618)

This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

      from  0ade4d7   Merge pull request #945 from pbchou/TS-4799
       new  5a901cf   Improve clang array formatting.
       new  5063618   TS-4423: Update Show Location Options.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmd/traffic_ctl/traffic_ctl.cc              |  2 +-
 doc/admin-guide/files/records.config.en.rst |  5 +++--
 lib/ts/Diags.cc                             |  4 ++--
 lib/ts/Diags.h                              |  8 +++++++-
 proxy/shared/DiagsConfig.cc                 | 16 +++++++++-------
 5 files changed, 22 insertions(+), 13 deletions(-)

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

[trafficserver] 01/02: Improve clang array formatting.

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 5a901cfde63133e170fb742cbcb2935ea0ec8e73
Author: James Peach <jp...@apache.org>
AuthorDate: Wed Aug 31 11:15:59 2016 -0700

    Improve clang array formatting.
---
 proxy/shared/DiagsConfig.cc | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/proxy/shared/DiagsConfig.cc b/proxy/shared/DiagsConfig.cc
index e7a009f..3dbb854 100644
--- a/proxy/shared/DiagsConfig.cc
+++ b/proxy/shared/DiagsConfig.cc
@@ -48,11 +48,13 @@ DiagsConfig::reconfigure_diags()
   static struct {
     const char *config_name;
     DiagsLevel level;
-  } output_records[] = {{"proxy.config.diags.output.diag", DL_Diag},           {"proxy.config.diags.output.debug", DL_Debug},
-                        {"proxy.config.diags.output.status", DL_Status},       {"proxy.config.diags.output.note", DL_Note},
-                        {"proxy.config.diags.output.warning", DL_Warning},     {"proxy.config.diags.output.error", DL_Error},
-                        {"proxy.config.diags.output.fatal", DL_Fatal},         {"proxy.config.diags.output.alert", DL_Alert},
-                        {"proxy.config.diags.output.emergency", DL_Emergency}, {NULL, DL_Undefined}};
+  } output_records[] = {
+    {"proxy.config.diags.output.diag", DL_Diag},           {"proxy.config.diags.output.debug", DL_Debug},
+    {"proxy.config.diags.output.status", DL_Status},       {"proxy.config.diags.output.note", DL_Note},
+    {"proxy.config.diags.output.warning", DL_Warning},     {"proxy.config.diags.output.error", DL_Error},
+    {"proxy.config.diags.output.fatal", DL_Fatal},         {"proxy.config.diags.output.alert", DL_Alert},
+    {"proxy.config.diags.output.emergency", DL_Emergency}, {NULL, DL_Undefined},
+  };
 
   if (!callbacks_established) {
     register_diags_callbacks();

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

[trafficserver] 02/02: TS-4423: Update Show Location Options.

Posted by jp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 5063618e2ad2d7c10a107f0eeaf4943c47b742fe
Author: Eric Schwartz <es...@inducedeuce.corp.gq1.yahoo.com>
AuthorDate: Thu Aug 25 20:39:11 2016 +0000

    TS-4423: Update Show Location Options.
    
    Don't show function / filename / line numbers on "operational logs".
    
    Previous behavior:
      0 - don't show any line numbers
      1 (DEFAULT) - show for all messages
    
    New behavior:
      0 - don't show any line numbers
      1 (DEFAULT) - show for Debug() messages only
      2 - show for all messages
    
    This closes #928.
---
 cmd/traffic_ctl/traffic_ctl.cc              | 2 +-
 doc/admin-guide/files/records.config.en.rst | 5 +++--
 lib/ts/Diags.cc                             | 4 ++--
 lib/ts/Diags.h                              | 8 +++++++-
 proxy/shared/DiagsConfig.cc                 | 4 ++--
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/cmd/traffic_ctl/traffic_ctl.cc b/cmd/traffic_ctl/traffic_ctl.cc
index 12224ed..c3559ac 100644
--- a/cmd/traffic_ctl/traffic_ctl.cc
+++ b/cmd/traffic_ctl/traffic_ctl.cc
@@ -240,7 +240,7 @@ main(int argc, const char **argv)
   if (debug) {
     diags->activate_taglist("traffic_ctl", DiagsTagType_Debug);
     diags->config.enabled[DiagsTagType_Debug] = true;
-    diags->show_location                      = true;
+    diags->show_location                      = SHOW_LOCATION_DEBUG;
   }
 
   CtrlDebug("debug logging active");
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 10852e8..104d030 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -2783,9 +2783,10 @@ Diagnostic Logging Configuration
 
         CONFIG proxy.config.diags.output.debug STRING SL
 
-.. ts:cv:: CONFIG proxy.config.diags.show_location INT 0
+.. ts:cv:: CONFIG proxy.config.diags.show_location INT 1
 
-   Annotates diagnostic messages with the source code location.
+   Annotates diagnostic messages with the source code location. Set to 1 to enable
+   for Debug() messages only. Set to 2 to enable for all messages.
 
 .. ts:cv:: CONFIG proxy.config.diags.debug.enabled INT 0
 
diff --git a/lib/ts/Diags.cc b/lib/ts/Diags.cc
index 71b5a09..7bf37bd 100644
--- a/lib/ts/Diags.cc
+++ b/lib/ts/Diags.cc
@@ -517,7 +517,7 @@ Diags::log(const char *tag, DiagsLevel level, const char *file, const char *func
 
   va_list ap;
   va_start(ap, format_string);
-  if (show_location) {
+  if (show_location == SHOW_LOCATION_ALL || (show_location == SHOW_LOCATION_DEBUG && level == DL_Debug)) {
     SourceLocation lp(file, func, line);
     print_va(tag, level, &lp, format_string, ap);
   } else {
@@ -535,7 +535,7 @@ Diags::error_va(DiagsLevel level, const char *file, const char *func, const int
     va_copy(ap2, ap);
   }
 
-  if (show_location) {
+  if (show_location == SHOW_LOCATION_ALL || (show_location == SHOW_LOCATION_DEBUG && level == DL_Debug)) {
     SourceLocation lp(file, func, line);
     print_va(NULL, level, &lp, format_string, ap);
   } else {
diff --git a/lib/ts/Diags.h b/lib/ts/Diags.h
index f898699..7d1f9c8 100644
--- a/lib/ts/Diags.h
+++ b/lib/ts/Diags.h
@@ -77,6 +77,12 @@ typedef enum {  // do not renumber --- used as array index
 
 enum RollingEnabledValues { NO_ROLLING = 0, ROLL_ON_TIME, ROLL_ON_SIZE, INVALID_ROLLING_VALUE };
 
+enum DiagsShowLocation {
+  SHOW_LOCATION_NONE = 0,
+  SHOW_LOCATION_DEBUG,
+  SHOW_LOCATION_ALL
+};
+
 #define DiagsLevel_Count DL_Undefined
 
 #define DiagsLevel_IsTerminal(_l) (((_l) >= DL_Fatal) && ((_l) < DL_Undefined))
@@ -168,7 +174,7 @@ public:
   {
     va_list ap;
     va_start(ap, format_string);
-    if (show_location) {
+    if (show_location == SHOW_LOCATION_ALL || (show_location == SHOW_LOCATION_DEBUG && dl == DL_Debug)) {
       SourceLocation lp(file, func, line);
       print_va(tag, dl, &lp, format_string, ap);
     } else {
diff --git a/proxy/shared/DiagsConfig.cc b/proxy/shared/DiagsConfig.cc
index 3dbb854..8b97f5d 100644
--- a/proxy/shared/DiagsConfig.cc
+++ b/proxy/shared/DiagsConfig.cc
@@ -84,7 +84,7 @@ DiagsConfig::reconfigure_diags()
   all_found = all_found && found;
 
   e                    = (int)REC_readInteger("proxy.config.diags.show_location", &found);
-  diags->show_location = ((e && found) ? 1 : 0);
+  diags->show_location = ((e == 1 && found) ? SHOW_LOCATION_DIAGS : ((e == 2 && found) ? SHOW_LOCATION_ALL : SHOW_LOCATION_NONE));
   all_found            = all_found && found;
 
   // read output routing values
@@ -248,7 +248,7 @@ DiagsConfig::RegisterDiagConfig()
   RecRegisterConfigString(RECT_CONFIG, "proxy.config.diags.debug.tags", "", RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
   RecRegisterConfigInt(RECT_CONFIG, "proxy.config.diags.action.enabled", 0, RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
   RecRegisterConfigString(RECT_CONFIG, "proxy.config.diags.action.tags", "", RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
-  RecRegisterConfigInt(RECT_CONFIG, "proxy.config.diags.show_location", 0, RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
+  RecRegisterConfigInt(RECT_CONFIG, "proxy.config.diags.show_location", 1, RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
   RecRegisterConfigString(RECT_CONFIG, "proxy.config.diags.output.diag", "L", RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
   RecRegisterConfigString(RECT_CONFIG, "proxy.config.diags.output.debug", "L", RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);
   RecRegisterConfigString(RECT_CONFIG, "proxy.config.diags.output.status", "L", RECU_NULL, RECC_NULL, NULL, REC_SOURCE_DEFAULT);

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