1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
package testing import ( "launchpad.net/gocheck" "launchpad.net/juju/go/log" ) // LoggingSuite redirects the juju logger to the test logger // when embedded in a gocheck suite type. type LoggingSuite struct { oldTarget log.Logger } func (t *LoggingSuite) SetUpTest(c *gocheck.C) { t.oldTarget = log.Target log.Target = c } func (t *LoggingSuite) TearDownTest(c *gocheck.C) { log.Target = t.oldTarget } |