blob: 387b4eb68909bf950a1c9d334ea8710d06c1854a [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001glog
2====
3
4Leveled execution logs for Go.
5
6This is an efficient pure Go implementation of leveled logs in the
7manner of the open source C++ package
8 https://github.com/google/glog
9
10By binding methods to booleans it is possible to use the log package
11without paying the expense of evaluating the arguments to the log.
12Through the -vmodule flag, the package also provides fine-grained
13control over logging at the file level.
14
15The comment from glog.go introduces the ideas:
16
17 Package glog implements logging analogous to the Google-internal
18 C++ INFO/ERROR/V setup. It provides functions Info, Warning,
19 Error, Fatal, plus formatting variants such as Infof. It
20 also provides V-style logging controlled by the -v and
21 -vmodule=file=2 flags.
22
23 Basic examples:
24
25 glog.Info("Prepare to repel boarders")
26
27 glog.Fatalf("Initialization failed: %s", err)
28
29 See the documentation for the V function for an explanation
30 of these examples:
31
32 if glog.V(2) {
33 glog.Info("Starting transaction...")
34 }
35
36 glog.V(2).Infoln("Processed", nItems, "elements")
37
38
39The repository contains an open source version of the log package
40used inside Google. The master copy of the source lives inside
41Google, not here. The code in this repo is for export only and is not itself
42under development. Feature requests will be ignored.
43
44Send bug reports to golang-nuts@googlegroups.com.