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
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

https://codereview.appspot.com/14592044/

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

https://codereview.appspot.com/14592044/

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :
Download full text (3.2 KiB)

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/~wallyworld/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):
   A [revision details]
   M environs/config/config.go
   M environs/config/config_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: tarmac-20131009221722-1lb0kalirzqc6s0b
+New revision: <email address hidden>

Index: environs/config/config.go
=== modified file 'environs/config/config.go'
--- environs/config/config.go 2013-10-04 12:18:17 +0000
+++ environs/config/config.go 2013-10-10 00:49:51 +0000
@@ -104,7 +104,15 @@
    if environmentValue := os.Getenv(osenv.JujuLoggingConfig);
environmentValue != "" {
     c.m["logging-config"] = environmentValue
    } else {
- c.m["logging-config"] = loggo.LoggerInfo()
+ //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-config"] = loggoConfig
+ } else {
+ c.m["logging-config"] = "<root>=DEBUG"
+ }
    }
   }

Index: environs/config/config_test.go
=== modified file 'environs/config/config_test.go'
--- environs/config/config_test.go 2013-09-27 02:00:34 +0000
+++ environs/config/config_test.go 2013-10-10 00:49:51 +0000
@@ -32,6 +32,11 @@

  var _ = gc.Suite(&ConfigSuite{})

+func (s *ConfigSuite) SetUpTest(c *gc.C) {
+ s.LoggingSuite.SetUpTest(c)
+ loggo.ResetLoggers()
+}
+
  // sampleConfig holds a configuration with all required
  // attributes set.
  var sampleConfig = testing.Attrs{
@@ -90,6 +95,14 @@
     "default-series": "",
    },
   }, {
+ 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(cfg.SSLHostnameVerification(), gc.Equals, v)
   }

+ if v, ok := test.attrs["logging-config"]; ok {
+ c.Assert(cfg.LoggingConfig(), gc.Equals, v)
+ } else {
+ c.Assert(cfg.LoggingConfig(), gc.Equals, "<root>=DEBUG")
+ }
+
   url, urlPresent := cfg.ImageMetadataURL()
   if v, _ := test.attrs["image-metadata-url"].(string); v != "" {
    c.Assert(url, gc.Equals, v)
@@ -764,6 +783,7 @@
   attrs["ca-private-key"] = ""
   attrs["image-metadata-url"] = ""
   attrs["tools-url"] = ""
+ attrs["logging-config"] = "<root>=DEBUG"
   // Default firewall mode is instance
   attrs["firewal...

Read more...

Revision history for this message
Dave Cheney (dave-cheney) wrote :
Download full text (4.2 KiB)

LGTM. Ship it

On Thu, Oct 10, 2013 at 11:57 AM, Ian Booth <email address hidden> wrote:
> 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/~wallyworld/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):
> A [revision details]
> M environs/config/config.go
> M environs/config/config_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: tarmac-20131009221722-1lb0kalirzqc6s0b
> +New revision: <email address hidden>
>
> Index: environs/config/config.go
> === modified file 'environs/config/config.go'
> --- environs/config/config.go 2013-10-04 12:18:17 +0000
> +++ environs/config/config.go 2013-10-10 00:49:51 +0000
> @@ -104,7 +104,15 @@
> if environmentValue := os.Getenv(osenv.JujuLoggingConfig);
> environmentValue != "" {
> c.m["logging-config"] = environmentValue
> } else {
> - c.m["logging-config"] = loggo.LoggerInfo()
> + //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-config"] = loggoConfig
> + } else {
> + c.m["logging-config"] = "<root>=DEBUG"
> + }
> }
> }
>
>
>
> Index: environs/config/config_test.go
> === modified file 'environs/config/config_test.go'
> --- environs/config/config_test.go 2013-09-27 02:00:34 +0000
> +++ environs/config/config_test.go 2013-10-10 00:49:51 +0000
> @@ -32,6 +32,11 @@
>
> var _ = gc.Suite(&ConfigSuite{})
>
> +func (s *ConfigSuite) SetUpTest(c *gc.C) {
> + s.LoggingSuite.SetUpTest(c)
> + loggo.ResetLoggers()
> +}
> +
> // sampleConfig holds a configuration with all required
> // attributes set.
> var sampleConfig = testing.Attrs{
> @@ -90,6 +95,14 @@
> "default-series": "",
> },
> }, {
> + about: "Explicit logging",
> + useDefaults: config.UseDefaults,
> + attrs: testing.Attrs{
> + "type": "my-type",
> + "name": "my-name",
> + "logging-config": "juju=INFO",
> + },
> + }, {
> about: ...

Read more...

Revision history for this message
Dave Cheney (dave-cheney) :
review: Approve (lgtm, you bloody ripper)
Revision history for this message
Ian Booth (wallyworld) wrote :

On 2013/10/10 00:56:14, wallyworld wrote:
> Please take a look.

Marked as LGTM by dave cheney in launchpad

https://codereview.appspot.com/14592044/

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (6.7 KiB)

The attempt to merge lp:~wallyworld/juju-core/default-debug-logging into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core/agent 0.659s
ok launchpad.net/juju-core/agent/tools 0.294s
ok launchpad.net/juju-core/bzr 7.311s
ok launchpad.net/juju-core/cert 3.047s
ok launchpad.net/juju-core/charm 0.587s
? launchpad.net/juju-core/charm/hooks [no test files]
ok launchpad.net/juju-core/cloudinit 0.027s
ok launchpad.net/juju-core/cmd 0.213s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/juju 170.751s
ok launchpad.net/juju-core/cmd/jujud 47.391s
ok launchpad.net/juju-core/cmd/plugins/juju-metadata 2.354s
ok launchpad.net/juju-core/constraints 0.026s
ok launchpad.net/juju-core/container/lxc 0.326s
? launchpad.net/juju-core/container/lxc/mock [no test files]
ok launchpad.net/juju-core/downloader 5.331s
ok launchpad.net/juju-core/environs 3.158s
ok launchpad.net/juju-core/environs/bootstrap 5.109s
ok launchpad.net/juju-core/environs/cloudinit 0.481s
ok launchpad.net/juju-core/environs/config 0.767s
ok launchpad.net/juju-core/environs/configstore 0.042s
ok launchpad.net/juju-core/environs/filestorage 0.030s
ok launchpad.net/juju-core/environs/httpstorage 0.960s
ok launchpad.net/juju-core/environs/imagemetadata 0.469s
ok launchpad.net/juju-core/environs/instances 0.052s
ok launchpad.net/juju-core/environs/jujutest 0.240s
ok launchpad.net/juju-core/environs/manual 4.292s
ok launchpad.net/juju-core/environs/simplestreams 0.329s
? launchpad.net/juju-core/environs/simplestreams/testing [no test files]
ok launchpad.net/juju-core/environs/sshstorage 1.110s
ok launchpad.net/juju-core/environs/storage 1.164s
ok launchpad.net/juju-core/environs/sync 28.256s
ok launchpad.net/juju-core/environs/testing 0.195s
ok launchpad.net/juju-core/environs/tools 6.873s
? launchpad.net/juju-core/environs/tools/testing [no test files]
ok launchpad.net/juju-core/errors 0.015s
ok launchpad.net/juju-core/instance 0.022s
? launchpad.net/juju-core/instance/testing [no test files]
ok launchpad.net/juju-core/juju 17.725s
ok launchpad.net/juju-core/juju/osenv 0.018s
? launchpad.net/juju-core/juju/testing [no test files]
ok launchpad.net/juju-core/log 0.015s
ok launchpad.net/juju-core/log/syslog 0.022s
ok launchpad.net/juju-core/names 0.024s
? launchpad.net/juju-core/provider [no test files]
? launchpad.net/juju-core/provider/all [no test files]
ok launchpad.net/juju-core/provider/azure 6.442s
ok launchpad.net/juju-core/provider/common 0.350s
ok launchpad.net/juju-core/provider/dummy 20.851s
ok launchpad.net/juju-core/provider/ec2 5.411s
ok launchpad.net/juju-core/provider/ec2/httpstorage 0.218s
ok launchpad.net/juju-core/provider/local 2.204s
ok launchpad.net/juju-core/provider/maas 3.681s
ok launchpad.net/juju-core/provider/null 1.245s
ok launchpad.net/juju-core/provider/openstack 13.389s
ok launchpad.net/juju-core/rpc 0.076s
ok launchpad.net/juju-core/rpc/jsoncodec 0.030s
? launchpad.net/juju-core/rpc/rpcreflect [no test files]
o...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'environs/config/config.go'
2--- environs/config/config.go 2013-10-04 12:18:17 +0000
3+++ environs/config/config.go 2013-10-10 00:55:55 +0000
4@@ -104,7 +104,15 @@
5 if environmentValue := os.Getenv(osenv.JujuLoggingConfig); environmentValue != "" {
6 c.m["logging-config"] = environmentValue
7 } else {
8- c.m["logging-config"] = loggo.LoggerInfo()
9+ //TODO(wallyworld) - 2013-10-10 bug=1237731
10+ // We need better way to ensure default logging is set to debug.
11+ // This is a *quick* fix to get 1.16 out the door.
12+ loggoConfig := loggo.LoggerInfo()
13+ if loggoConfig != "<root>=WARNING" {
14+ c.m["logging-config"] = loggoConfig
15+ } else {
16+ c.m["logging-config"] = "<root>=DEBUG"
17+ }
18 }
19 }
20
21
22=== modified file 'environs/config/config_test.go'
23--- environs/config/config_test.go 2013-09-27 02:00:34 +0000
24+++ environs/config/config_test.go 2013-10-10 00:55:55 +0000
25@@ -32,6 +32,11 @@
26
27 var _ = gc.Suite(&ConfigSuite{})
28
29+func (s *ConfigSuite) SetUpTest(c *gc.C) {
30+ s.LoggingSuite.SetUpTest(c)
31+ loggo.ResetLoggers()
32+}
33+
34 // sampleConfig holds a configuration with all required
35 // attributes set.
36 var sampleConfig = testing.Attrs{
37@@ -90,6 +95,14 @@
38 "default-series": "",
39 },
40 }, {
41+ about: "Explicit logging",
42+ useDefaults: config.UseDefaults,
43+ attrs: testing.Attrs{
44+ "type": "my-type",
45+ "name": "my-name",
46+ "logging-config": "juju=INFO",
47+ },
48+ }, {
49 about: "Explicit authorized-keys",
50 useDefaults: config.UseDefaults,
51 attrs: testing.Attrs{
52@@ -721,6 +734,12 @@
53 c.Assert(cfg.SSLHostnameVerification(), gc.Equals, v)
54 }
55
56+ if v, ok := test.attrs["logging-config"]; ok {
57+ c.Assert(cfg.LoggingConfig(), gc.Equals, v)
58+ } else {
59+ c.Assert(cfg.LoggingConfig(), gc.Equals, "<root>=DEBUG")
60+ }
61+
62 url, urlPresent := cfg.ImageMetadataURL()
63 if v, _ := test.attrs["image-metadata-url"].(string); v != "" {
64 c.Assert(url, gc.Equals, v)
65@@ -764,6 +783,7 @@
66 attrs["ca-private-key"] = ""
67 attrs["image-metadata-url"] = ""
68 attrs["tools-url"] = ""
69+ attrs["logging-config"] = "<root>=DEBUG"
70 // Default firewall mode is instance
71 attrs["firewall-mode"] = string(config.FwInstance)
72 c.Assert(cfg.AllAttrs(), gc.DeepEquals, attrs)

Subscribers

People subscribed via source and target branches

to status/vote changes: