Merge lp:~wallyworld/juju-core/default-debug-logging into lp:~go-bot/juju-core/trunk
Proposed by
Ian Booth
Status: | Merged |
---|---|
Approved by: | Ian Booth |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1974 |
Proposed branch: | lp:~wallyworld/juju-core/default-debug-logging |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
72 lines (+29/-1) 2 files modified
environs/config/config.go (+9/-1) environs/config/config_test.go (+20/-0) |
To merge this branch: | bzr merge lp:~wallyworld/juju-core/default-debug-logging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dave Cheney (community) | lgtm, you bloody ripper | Approve | |
Review via email: mp+190282@code.launchpad.net |
Commit message
Agents log using debug by default
This branch changes the default logging level for agents to use debug.
The level is set to debug only if the user has not specified something
different via logging-config or JUJU_LOGGING_CONFIG
Description of the change
Agents log using debug by default
This branch changes the default logging level for agents to use debug.
The level is set to debug only if the user has not specified something
different via logging-config or JUJU_LOGGING_CONFIG
To post a comment you must log in.
Reviewers: mp+190282_ code.launchpad. net,
Message:
Please take a look.
Description:
Agents log using debug by default
This branch changes the default logging level for agents to use debug.
The level is set to debug only if the user has not specified something
different via logging-config or JUJU_LOGGING_CONFIG
https:/ /code.launchpad .net/~wallyworl d/juju- core/default- debug-logging/ +merge/ 190282
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14592044/
Affected files (+31, -1 lines): config/ config. go config/ config_ test.go
A [revision details]
M environs/
M environs/
Index: [revision details] 20131009221722- 1lb0kalirzqc6s0 b
=== 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: tarmac-
+New revision: <email address hidden>
Index: environs/ config/ config. go config/ config. go' config/ config. go 2013-10-04 12:18:17 +0000 config/ config. go 2013-10-10 00:49:51 +0000 osenv.JujuLoggi ngConfig) ; m["logging- config" ] = environmentValue config" ] = loggo.LoggerInfo() config" ] = loggoConfig config" ] = "<root>=DEBUG"
=== modified file 'environs/
--- environs/
+++ environs/
@@ -104,7 +104,15 @@
if environmentValue := os.Getenv(
environmentValue != "" {
c.
} else {
- c.m["logging-
+ //TODO(wallyworld) - 2013-10-10 bug=1237731
+ // We need better way to ensure default logging is set to debug.
+ // This is a *quick* fix to get 1.16 out the door.
+ loggoConfig := loggo.LoggerInfo()
+ if loggoConfig != "<root>=WARNING" {
+ c.m["logging-
+ } else {
+ c.m["logging-
+ }
}
}
Index: environs/ config/ config_ test.go config/ config_ test.go' config/ config_ test.go 2013-09-27 02:00:34 +0000 config/ config_ test.go 2013-10-10 00:49:51 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -32,6 +32,11 @@
var _ = gc.Suite( &ConfigSuite{ })
+func (s *ConfigSuite) SetUpTest(c *gc.C) { SetUpTest( c) ers() series" : "", cfg.SSLHostname Verification( ), gc.Equals, v)
+ s.LoggingSuite.
+ loggo.ResetLogg
+}
+
// sampleConfig holds a configuration with all required
// attributes set.
var sampleConfig = testing.Attrs{
@@ -90,6 +95,14 @@
"default-
},
}, {
+ about: "Explicit logging",
+ useDefaults: config.UseDefaults,
+ attrs: testing.Attrs{
+ "type": "my-type",
+ "name": "my-name",
+ "logging-config": "juju=INFO",
+ },
+ }, {
about: "Explicit authorized-keys",
useDefaults: config.UseDefaults,
attrs: testing.Attrs{
@@ -721,6 +734,12 @@
c.Assert(
}
+ if v, ok := test.attrs[ "logging- config" ]; ok { cfg.LoggingConf ig(), gc.Equals, v) cfg.LoggingConf ig(), gc.Equals, "<root>=DEBUG") taURL() "image- metadata- url"].( string) ; v != "" { "ca-private- key"] = "" "image- metadata- url"] = "" "tools- url"] = "" logging- config" ] = "<root>=DEBUG" "firewal. ..
+ c.Assert(
+ } else {
+ c.Assert(
+ }
+
url, urlPresent := cfg.ImageMetada
if v, _ := test.attrs[
c.Assert(url, gc.Equals, v)
@@ -764,6 +783,7 @@
attrs[
attrs[
attrs[
+ attrs["
// Default firewall mode is instance
attrs[