summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralabid <alabidan@gmail.com>2014-10-21 16:10:27 -0400
committeralabid <alabidan@gmail.com>2014-10-21 16:15:33 -0400
commit38e934bddb98f2fbd0ee3cc8d49b96604b0f8add (patch)
tree7c175ef3c49354f955246f6ed0802a3b18ec1e22
parent2221a861196ab6c61b215913055cfdd079794a99 (diff)
downloadmongo-38e934bddb98f2fbd0ee3cc8d49b96604b0f8add.tar.gz
TOOLS-299 (related) connection url for mongotop,mongofiles should be logged via tool logger
Former-commit-id: 93463a3da1b0e2b7d0616a041e5643d4c5602799
-rw-r--r--mongofiles/mongofiles.go2
-rw-r--r--mongotop/mongotop.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/mongofiles/mongofiles.go b/mongofiles/mongofiles.go
index da418657c17..cd0e8bdd9db 100644
--- a/mongofiles/mongofiles.go
+++ b/mongofiles/mongofiles.go
@@ -194,7 +194,7 @@ func (self *MongoFiles) Run(displayConnUrl bool) (string, error) {
session.SetSocketTimeout(0)
if displayConnUrl {
- fmt.Printf("connected to: %v\n", connUrl)
+ log.Logf(log.Always, "connected to: %v\n", connUrl)
}
if self.ToolOptions.Namespace.DB == "" {
diff --git a/mongotop/mongotop.go b/mongotop/mongotop.go
index 0ce597b41e3..dee35187cb8 100644
--- a/mongotop/mongotop.go
+++ b/mongotop/mongotop.go
@@ -5,6 +5,7 @@ package mongotop
import (
"fmt"
"github.com/mongodb/mongo-tools/common/db"
+ "github.com/mongodb/mongo-tools/common/log"
commonopts "github.com/mongodb/mongo-tools/common/options"
"github.com/mongodb/mongo-tools/mongotop/command"
"github.com/mongodb/mongo-tools/mongotop/options"
@@ -48,7 +49,7 @@ func (self *MongoTop) Run() error {
if self.Options.Port != "" {
connUrl = connUrl + ":" + self.Options.Port
}
- fmt.Printf("connected to: %v\n", connUrl)
+ log.Logf(log.Always, "connected to: %v\n", connUrl)
// the results used to be compared to each other
var previousResults command.Command