/usr/share/gocode/src/github.com/juju/loggo/formatter_test.go is in golang-github-juju-loggo-dev 0.0~git20150527.0.8477fc9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // Copyright 2014 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package loggo_test
import (
"time"
gc "gopkg.in/check.v1"
"github.com/juju/loggo"
)
type formatterSuite struct{}
var _ = gc.Suite(&formatterSuite{})
func (*formatterSuite) TestDefaultFormat(c *gc.C) {
location, err := time.LoadLocation("UTC")
c.Assert(err, gc.IsNil)
testTime := time.Date(2013, 5, 3, 10, 53, 24, 123456, location)
formatter := &loggo.DefaultFormatter{}
formatted := formatter.Format(loggo.WARNING, "test.module", "some/deep/filename", 42, testTime, "hello world!")
c.Assert(formatted, gc.Equals, "2013-05-03 10:53:24 WARNING test.module filename:42 hello world!")
}
|