1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 func ExampleLogger() {
16 logger = log.New(&buf, "logger: ", log.Lshortfile)
19 logger.Print("Hello, log file!")
23 // logger: example_test.go:19: Hello, log file!
26 func ExampleLogger_Output() {
29 logger = log.New(&buf, "INFO: ", log.Lshortfile)
31 infof = func(info string) {
32 logger.Output(2, info)
40 // INFO: example_test.go:36: Hello world