Documentation ¶
Overview ¶
Package logthis provides a way to either print, log, and/or send a string to channels. Provides a default logger initiated on import.
Index ¶
- Constants
- Variables
- func CheckLevel(value int) error
- func Error(err error, level int)
- func ErrorIfNotNil(errs []error, level int)
- func Info(msg string, level int)
- func SetLevel(value int)
- func SetOutputWriter(writer io.Writer)
- func SetStdOutput(value bool)
- func Subscribe() chan interface{}
- func TimedError(err error, level int)
- func TimedInfo(msg string, level int)
- func Unsubscribe(msgCh chan interface{})
- type LogThis
Constants ¶
View Source
const ( NORMAL = iota VERBOSE VERBOSEST VERBOSESTEST )
Variables ¶
View Source
var (
ErrInvalidLogLevel = errors.New("invalid log level")
)
Functions ¶
func CheckLevel ¶ added in v0.36.2
func ErrorIfNotNil ¶ added in v0.17.0
ErrorIfNotNil logs non-nil errors from a slice.
func SetOutputWriter ¶ added in v0.37.0
func SetStdOutput ¶
func SetStdOutput(value bool)
func TimedError ¶ added in v0.33.0
TimedError logs an error prefixed with the time elapsed since the program started.
func TimedInfo ¶ added in v0.18.1
TimedInfo logs a message prefixed with the time elapsed since the program started.
func Unsubscribe ¶ added in v0.7.0
func Unsubscribe(msgCh chan interface{})
Types ¶
Click to show internal directories.
Click to hide internal directories.