Skip to content

Commit ff7fb9e

Browse files
committed
Add Stdout and Stderr variables
1 parent 18e99f1 commit ff7fb9e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: log.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@ import (
55
"os"
66
)
77

8+
// Stdout, and Stderr are open Files pointing to the standard output,
9+
// and standard error file descriptors.
10+
var (
11+
Stdout = os.Stdout
12+
Stderr = os.Stderr
13+
)
14+
815
// Log to standard output.
916
func Log(format string, a ...interface{}) {
1017
fmt.Printf(format+"\n", a...)
1118
}
1219

1320
// Fatal prints to os.Stderr, followed by a call to os.Exit(1).
1421
func Fatal(v ...interface{}) {
15-
fmt.Fprintln(os.Stderr, v...)
22+
fmt.Fprintln(Stderr, v...)
1623
os.Exit(1)
1724
}
1825

0 commit comments

Comments
 (0)