msg

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var Verbose bool

Verbose controls additional optional output for Tell.

Functions

func FatalInfoOnErr

func FatalInfoOnErr(err error, info string)

FatalInfoOnErr ends in osExit(1) if err not nil.

func FatalInfoOnFalse added in v0.26.0

func FatalInfoOnFalse(flag bool, info string)

FatalInfoOnFalse prints info and a common error message with location info when err is not nil.

func FatalInfoOnTrue added in v0.26.0

func FatalInfoOnTrue(flag bool, info string)

FatalInfoOnTrue prints info and a common error message with location info when err is not nil.

func FatalOnErr

func FatalOnErr(err error)

FatalOnErr ends in osExit(1) if err not nil.

func FatalOnFalse

func FatalOnFalse(flag bool)

FatalOnFalse ends in osExit(1) if flag is false.

func FatalOnTrue

func FatalOnTrue(flag bool)

FatalOnTrue ends in osExit(1) if flag is true.

func Info

func Info(info string)

Info prints info with location info.

func InfoOnErr

func InfoOnErr(err error, info string)

InfoOnErr prints info and a common error message with location info when err is not nil.

func InfoOnFalse

func InfoOnFalse(flag bool, info string)

InfoOnFalse prints info and a common error message with location info when flag is false.

func InfoOnTrue

func InfoOnTrue(flag bool, info string)

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

func OnErrF(w io.Writer, err error)

OnErrF prints info and a common error message with location info when err is not nil.

func OnErrFv added in v0.70.0

func OnErrFv(w io.Writer, err error) error

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

func Tell added in v0.70.0

func Tell(w io.Writer, info string)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL