You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2020/11/02 20:24:52 UTC

[trafficcontrol] branch 4.1.x updated: Fixed logging.yaml generation to properly add a newline after filters are emitted. (#4846) (#5232)

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

rawlin pushed a commit to branch 4.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/4.1.x by this push:
     new a991157  Fixed logging.yaml generation to properly add a newline after filters are emitted. (#4846) (#5232)
a991157 is described below

commit a991157de04ba0cc7e5170ecea746c01acb57cb9
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Mon Nov 2 13:24:29 2020 -0700

    Fixed logging.yaml generation to properly add a newline after filters are emitted. (#4846) (#5232)
    
    Fixes #4845.
    
    (cherry picked from commit fd6e0dd7b42e0a5db2fef6b8b9a471644abd2f9a)
    
    Co-authored-by: alficles <al...@gmail.com>
---
 lib/go-atscfg/loggingdotyaml.go      | 2 +-
 lib/go-atscfg/loggingdotyaml_test.go | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/go-atscfg/loggingdotyaml.go b/lib/go-atscfg/loggingdotyaml.go
index ab5fc00..746721d 100644
--- a/lib/go-atscfg/loggingdotyaml.go
+++ b/lib/go-atscfg/loggingdotyaml.go
@@ -125,7 +125,7 @@ func MakeLoggingDotYAML(
 			}
 			if logObjectFilters != "" {
 				logObjectFilters = strings.Replace(logObjectFilters, "\v", "", -1)
-				text += "  filters: [" + logObjectFilters + "]"
+				text += "  filters: [" + logObjectFilters + "]\n"
 			}
 		}
 	}
diff --git a/lib/go-atscfg/loggingdotyaml_test.go b/lib/go-atscfg/loggingdotyaml_test.go
index 121afc0..3e6899d 100644
--- a/lib/go-atscfg/loggingdotyaml_test.go
+++ b/lib/go-atscfg/loggingdotyaml_test.go
@@ -70,6 +70,7 @@ func TestMakeLoggingDotYAMLMultiFormat(t *testing.T) {
 		"LogFormat.Format":         "myFormat0",
 		"LogFormat1.Name":          "myFormatName1",
 		"LogFormat1.Format":        "myFormat1",
+		"LogFormat1.Filters":       "myFilter",
 		"LogFormat9.Name":          "myFormatName9",
 		"LogFormat9.Format":        "myFormat9",
 		"LogFormat2.Name":          "myFormatName2",
@@ -89,6 +90,8 @@ func TestMakeLoggingDotYAMLMultiFormat(t *testing.T) {
 		"LogObject9.Format":        "myFormatName9",
 		"LogObject1.Filename":      "myFilename1",
 		"LogObject1.Format":        "myFormatName1",
+		"LogFilter.Name":           "myFilterName",
+		"LogFilter.Filter":         "myFilter",
 	}
 
 	txt := MakeLoggingDotYAML(profileName, paramData, toolName, toURL)