Merge lp://staging/~thumper/juju-core/verbose-means-info into lp://staging/~juju/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Merged at revision: | 1256 |
Proposed branch: | lp://staging/~thumper/juju-core/verbose-means-info |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
65 lines (+29/-3) 2 files modified
cmd/logging.go (+6/-2) cmd/logging_test.go (+23/-1) |
To merge this branch: | bzr merge lp://staging/~thumper/juju-core/verbose-means-info |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+167687@code.staging.launchpad.net |
Description of the change
Have the verbose flag set the log level to INFO.
When the loggo branch landed yesterday, there was a change in behaviour with
the --verbose flag, where it did log to stderr, but it was at the WARNING
level, not INFO.
To post a comment you must log in.
Reviewers: mp+167687_ code.launchpad. net,
Message:
Please take a look.
Description:
Have the verbose flag set the log level to INFO.
When the loggo branch landed yesterday, there was a change in behaviour
with
the --verbose flag, where it did log to stderr, but it was at the
WARNING
level, not INFO.
https:/ /code.launchpad .net/~thumper/ juju-core/ verbose- means-info/ +merge/ 167687
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/9698047/
Affected files:
A [revision details]
M cmd/logging.go
M cmd/logging_test.go
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: cmd/logging.go RemoveWriter( "default" ) ("juju" ) SetLogLevel( loggo.DEBUG) SetLogLevel( level) ConfigureLoggin g(l.Config)
=== modified file 'cmd/logging.go'
--- cmd/logging.go 2013-06-05 02:44:14 +0000
+++ cmd/logging.go 2013-06-06 03:55:42 +0000
@@ -52,9 +52,13 @@
} else {
loggo.
}
- if l.Debug {
+ if l.Verbose || l.Debug {
+ var level = loggo.INFO
+ if l.Debug {
+ level = loggo.DEBUG
+ }
logger := loggo.GetLogger
- logger.
+ logger.
}
loggo.
return nil
Index: cmd/logging_test.go test.go'
=== modified file 'cmd/logging_
--- cmd/logging_test.go 2013-05-30 03:41:19 +0000
+++ cmd/logging_test.go 2013-06-06 03:55:22 +0000
@@ -5,11 +5,13 @@
import ( net/gocheck" net/juju- core/cmd" net/juju- core/log" net/juju- core/testing" net/loggo"
"io/ioutil"
+ "path/filepath"
+
. "launchpad.
"launchpad.
"launchpad.
"launchpad.
- "path/filepath"
+ "launchpad.
)
type LogSuite struct { l.Config, Equals, "juju.cmd= INFO;juju. worker. deployer= DEBUG")
@@ -38,6 +40,26 @@
c.Assert(
}
+func (s *LogSuite) TestVerboseSets LogLevel( c *C) { ("juju" ) logger. GetLogLevel( ), Equals, loggo.INFO) gLevel( c *C) { ("juju" ) logger. GetLogLevel( ), Equals, loggo.DEBUG)
+ l := &cmd.Log{Verbose: true}
+ ctx := testing.Context(c)
+ err := l.Start(ctx)
+ c.Assert(err, IsNil)
+
+ logger := loggo.GetLogger
+ c.Assert(
+}
+
+func (s *LogSuite) TestDebugSetsLo
+ l := &cmd.Log{Debug: true}
+ ctx := testing.Context(c)
+ err := l.Start(ctx)
+ c.Assert(err, IsNil)
+
+ logger := loggo.GetLogger
+ c.Assert(
+}
+
func (s *LogSuite) TestStderr(c *C) {
l := &cmd.Log{Verbose: true, Config: "<root>=INFO"}
ctx := testing.Context(c)