Merge lp:~pedronis/ubuntu-push/explicit-min-logger-be-kind-to-1.1 into lp:ubuntu-push

Proposed by Samuele Pedroni
Status: Merged
Approved by: Samuele Pedroni
Approved revision: 55
Merged at revision: 56
Proposed branch: lp:~pedronis/ubuntu-push/explicit-min-logger-be-kind-to-1.1
Merge into: lp:ubuntu-push
Diff against target: 37 lines (+7/-6)
2 files modified
logger/logger.go (+6/-3)
testing/helpers.go (+1/-3)
To merge this branch: bzr merge lp:~pedronis/ubuntu-push/explicit-min-logger-be-kind-to-1.1
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+205129@code.launchpad.net

Commit message

be explicit with the MinLogger interface, stops 1.1 compiler from exploding

Description of the change

this stops the 1.1 compiler to explode trying to compiler logger related stuff

To post a comment you must log in.
55. By Samuele Pedroni

fix comment

Revision history for this message
John Lenton (chipaca) wrote :

Ok. :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'logger/logger.go'
2--- logger/logger.go 2014-02-04 21:40:32 +0000
3+++ logger/logger.go 2014-02-06 11:23:10 +0000
4@@ -59,12 +59,15 @@
5 "debug": lDebug,
6 }
7
8+// MinimalLogger is the minimal interface required to build a simple logger on top.
9+type MinimalLogger interface {
10+ Output(calldepth int, s string) error
11+}
12+
13 // NewSimpleLoggerFromMinimalLogger creates a logger logging only up
14 // to the given level. level can be in order: "error", "info",
15 // "debug". It takes a value just implementing stlib Logger.Output().
16-func NewSimpleLoggerFromMinimalLogger(minLog interface {
17- Output(calldepth int, s string) error
18-}, level string) Logger {
19+func NewSimpleLoggerFromMinimalLogger(minLog MinimalLogger, level string) Logger {
20 nlevel := levelToNLevel[level]
21 return &simpleLogger{
22 minLog.Output,
23
24=== modified file 'testing/helpers.go'
25--- testing/helpers.go 2014-02-04 22:30:42 +0000
26+++ testing/helpers.go 2014-02-06 11:23:10 +0000
27@@ -71,9 +71,7 @@
28 }
29
30 // NewTestLogger can be used in tests instead of NewSimpleLogger(FromMinimalLogger).
31-func NewTestLogger(minLog interface {
32- Output(int, string) error
33-}, level string) *TestLogger {
34+func NewTestLogger(minLog logger.MinimalLogger, level string) *TestLogger {
35 h := &captureHelper{outputFunc: minLog.Output}
36 log := &TestLogger{
37 Logger: logger.NewSimpleLoggerFromMinimalLogger(h, level),

Subscribers

People subscribed via source and target branches