Skip to content

Commit f74c4c6

Browse files
committed
Add documentation about flushing and flags.
1 parent ab6a54c commit f74c4c6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

glog.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,37 @@
3232
//
3333
// glog.V(2).Infoln("Processed", nItems, "elements")
3434
//
35+
// Log output is buffered and written periodically using Flush. Programs
36+
// should call Flush before exiting to guarantee all log output is written.
37+
//
38+
// By default, all log statements write to files in a temporary directory.
39+
// This package provides several flags that modify this behavior.
40+
//
41+
// -logtostderr=false
42+
// Logs are written to standard error instead of to files.
43+
// -alsologtostderr=false
44+
// Logs are written to standard error as well as to files.
45+
// -stderrthreshold=ERROR
46+
// Log events at or above this severity are logged to standard
47+
// error as well as to files.
48+
//
49+
// Other flags provide aids to debugging.
50+
//
51+
// -log_backtrace_at=""
52+
// When set to a file and line number holding a logging statement,
53+
// such as
54+
// -log_backtrace_at=gopherflakes.go:234
55+
// a stack trace will be written to the Info log whenever execution
56+
// hits that statement. (Unlike with -vmodule, the ".go" must be
57+
// present.)
58+
// -v=0
59+
// Enable V-leveled logging at the specified level.
60+
// -vmodule=""
61+
// The syntax of the argument is a comma-separate list of pattern=N,
62+
// where pattern is a literal file name (minus the ".go" suffix) or
63+
// "glob" pattern and N is a V level. For instance, -vmodule=gopher*=3
64+
// sets the V level to 3 in all Go files whose names begin "gopher".
65+
//
3566
package glog
3667

3768
import (

0 commit comments

Comments
 (0)