You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by iw...@apache.org on 2015/11/29 17:35:49 UTC

incubator-htrace git commit: HTRACE-311. htraced: Fix logging to stdout via -Dlog.path= (Colin Patrick McCabe via iwasakims)

Repository: incubator-htrace
Updated Branches:
  refs/heads/master f2c2ef157 -> eb5955da5


HTRACE-311. htraced: Fix logging to stdout via -Dlog.path= (Colin Patrick McCabe via iwasakims)


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/eb5955da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/eb5955da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/eb5955da

Branch: refs/heads/master
Commit: eb5955da5042ac3447a218ba85c1f58dafb65f72
Parents: f2c2ef1
Author: Masatake Iwasaki <iw...@apache.org>
Authored: Sat Nov 28 10:43:46 2015 +0900
Committer: Masatake Iwasaki <iw...@apache.org>
Committed: Sat Nov 28 10:43:46 2015 +0900

----------------------------------------------------------------------
 htrace-htraced/go/src/org/apache/htrace/conf/config.go      | 4 ++--
 htrace-htraced/go/src/org/apache/htrace/conf/config_test.go | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/eb5955da/htrace-htraced/go/src/org/apache/htrace/conf/config.go
----------------------------------------------------------------------
diff --git a/htrace-htraced/go/src/org/apache/htrace/conf/config.go b/htrace-htraced/go/src/org/apache/htrace/conf/config.go
index cb1d8b4..24170b2 100644
--- a/htrace-htraced/go/src/org/apache/htrace/conf/config.go
+++ b/htrace-htraced/go/src/org/apache/htrace/conf/config.go
@@ -217,8 +217,8 @@ func (cnf *Config) Contains(key string) bool {
 
 // Get a string configuration key.
 func (cnf *Config) Get(key string) string {
-	ret := cnf.settings[key]
-	if ret != "" {
+	ret, hadKey := cnf.settings[key]
+	if hadKey {
 		return ret
 	}
 	return cnf.defaults[key]

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/eb5955da/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
----------------------------------------------------------------------
diff --git a/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go b/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
index 9059dad..a681136 100644
--- a/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
+++ b/htrace-htraced/go/src/org/apache/htrace/conf/config_test.go
@@ -30,7 +30,10 @@ import (
 func TestParseArgV(t *testing.T) {
 	t.Parallel()
 	argv := []string{"-Dfoo=bar", "-Dbaz=123", "-DsillyMode", "-Dlog.path="}
-	bld := &Builder{Argv: argv}
+	bld := &Builder{Argv: argv,
+		Defaults:map[string]string {
+			"log.path": "/log/path/default",
+		}}
 	cnf, err := bld.Build()
 	if err != nil {
 		t.Fatal()