Skip to content

Commit 3e682cc

Browse files
committed
Initial commit.
This is a sanitized, degoogled version of the internal Google logging package for Go. It is in effect the Go version of code.google.com/p/google-glog, the C++ original. Changes from the Go original: - changing the package name from log to glog - taking out Google-specific details - removing some environment variables
1 parent 2d42ba6 commit 3e682cc

File tree

5 files changed

+1557
-4
lines changed

5 files changed

+1557
-4
lines changed

README

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
glog
2+
====
3+
4+
Leveled execution logs for Go.
5+
6+
This is an efficient pure Go implementation of leveled logs in the
7+
manner of the open source C++ package
8+
http://code.google.com/p/google-glog
9+
10+
By binding methods to booleans it is possible to use the log package
11+
without paying the expense of evaluating the arguments to the log.
12+
Through the -vmodule flag, the package also provides fine-grained
13+
control over logging at the file level.
14+
15+
The 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+
39+
The repository contains an open source version of the log package
40+
used inside Google. The master copy of the source lives inside
41+
Google, not here. The code in this repo is for export only and is not itself
42+
under development. Feature requests will be ignored.
43+
44+
Send bug reports to [email protected].

README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)