Documentation
¶
Overview ¶
Package msg contains small logging and diagnostic helpers used across Trice.
The helpers include informational output, fatal wrappers, and guarded test hooks for replacing process-exit behavior.
Index ¶
- Variables
- func FatalInfoOnErr(err error, info string)
- func FatalInfoOnFalse(flag bool, info string)
- func FatalInfoOnTrue(flag bool, info string)
- func FatalOnErr(err error)
- func FatalOnFalse(flag bool)
- func FatalOnTrue(flag bool)
- func Info(info string)
- func InfoOnErr(err error, info string)
- func InfoOnFalse(flag bool, info string)
- func InfoOnTrue(flag bool, info string)
- func OnErr(err error)
- func OnErrF(w io.Writer, err error)
- func OnErrFv(w io.Writer, err error) error
- func OnFalse(flag bool)
- func OnTrue(flag bool)
- func OsExitAllow(o OrigLogFatalf)
- func Tell(w io.Writer, info string)
- type OrigLogFatalf
Constants ¶
This section is empty.
Variables ¶
var Verbose bool
Verbose controls additional optional output for Tell.
Functions ¶
func FatalInfoOnErr ¶
FatalInfoOnErr ends in osExit(1) if err not nil.
func FatalInfoOnFalse ¶ added in v0.26.0
FatalInfoOnFalse prints info and a common error message with location info when err is not nil.
func FatalInfoOnTrue ¶ added in v0.26.0
FatalInfoOnTrue prints info and a common error message with location info when err is not nil.
func InfoOnErr ¶
InfoOnErr prints info and a common error message with location info when err is not nil.
func InfoOnFalse ¶
InfoOnFalse prints info and a common error message with location info when flag is false.
func InfoOnTrue ¶
InfoOnTrue prints info and a common error message with location info when flag is true.
func OnErr ¶
func OnErr(err error)
OnErr prints info and a common error message with location info when err is not nil.
func OnErrF ¶ added in v0.44.0
OnErrF prints info and a common error message with location info when err is not nil.
func OnErrFv ¶ added in v0.70.0
OnErrFv prints info and a common error message with location info when err is not nil.
func OnFalse ¶
func OnFalse(flag bool)
OnFalse prints info and a common error message with location info when flag is false.
func OnTrue ¶
func OnTrue(flag bool)
OnTrue prints info and a common error message with location info when flag is true.
func OsExitAllow ¶ added in v0.29.2
func OsExitAllow(o OrigLogFatalf)
OsExitAllow place the original fatal function back
Types ¶
type OrigLogFatalf ¶ added in v0.49.0
type OrigLogFatalf func(format string, v ...interface{})
func OsExitDisallow ¶ added in v0.29.2
func OsExitDisallow() (o OrigLogFatalf)
OsExitDisallow replace the original fatal function