Skip to content

Commit 7920fdf

Browse files
committed
documentation note that you can use Flag pkg with SetXxxTracers
1 parent 1bff1fc commit 7920fdf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tracer.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func LogTracer() io.Writer {
3131
//
3232
// func CopyFile(src, dst string) (err error) {
3333
// defer err2.Handle(&err) // <- error trace print decision is done here
34+
//
35+
// Remember that you can overwrite these with Flag package support. See
36+
// documentation of err2 package's flag section.
3437
func SetErrorTracer(w io.Writer) {
3538
tracer.Error.SetTracer(w)
3639
}
@@ -43,6 +46,9 @@ func SetErrorTracer(w io.Writer) {
4346
//
4447
// func CopyFile(src, dst string) (err error) {
4548
// defer err2.Handle(&err) // <- error trace print decision is done here
49+
//
50+
// Remember that you can overwrite these with Flag package support. See
51+
// documentation of err2 package's flag section.
4652
func SetPanicTracer(w io.Writer) {
4753
tracer.Panic.SetTracer(w)
4854
}
@@ -54,12 +60,18 @@ func SetPanicTracer(w io.Writer) {
5460
// glog, add this line at the beginning of your app:
5561
//
5662
// glog.CopyStandardLogTo("INFO")
63+
//
64+
// Remember that you can overwrite these with Flag package support. See
65+
// documentation of err2 package's flag section.
5766
func SetLogTracer(w io.Writer) {
5867
tracer.Log.SetTracer(w)
5968
}
6069

6170
// SetTracers a convenient helper to set a io.Writer for error and panic stack
6271
// tracing. More information see SetErrorTracer and SetPanicTracer functions.
72+
//
73+
// Remember that you can overwrite these with Flag package support. See
74+
// documentation of err2 package's flag section.
6375
func SetTracers(w io.Writer) {
6476
tracer.Error.SetTracer(w)
6577
tracer.Panic.SetTracer(w)

0 commit comments

Comments
 (0)