logger

package
v0.0.0-...-3c33c60 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 7 Imported by: 5

README

codecov

logger

Simple go logger with logging level. Default output will be like this:

09/29 13:29:04.355: *****: [core-logger.Test_BasicUsage:22]: Hello world arg1 arg2
09/29 13:29:04.373: !!!: [core-logger.Test_BasicUsage:23]: My warning
09/29 13:29:04.374: ===: [core-logger.Test_BasicUsage:24]: My info
09/29 13:29:04.374: ---: [core-logger.Test_BasicUsage:35]: Now you should see my Trace
09/29 13:29:04.374: !!!: [core-logger.Test_BasicUsage:41]: You should see my warning
09/29 13:29:04.374: !!!: [core-logger.Test_BasicUsage:42]: You should see my info
09/29 13:29:04.374: *****: [core-logger.(*mystruct).iWantToLog:55]: OOPS

See impl_test.Test_BasicUsage for examples

Documentation

Index

Constants

View Source
const (
	LogLevelNone = TLogLevel(iota)
	LogLevelError
	LogLevelWarning
	LogLevelInfo
	LogLevelVerbose // aka Debug
	LogLevelTrace
)

Log Levels enum

Variables

View Source
var PrintLine func(level TLogLevel, line string) = DefaultPrintLine

Functions

func DefaultPrintLine

func DefaultPrintLine(level TLogLevel, line string)

func Error

func Error(args ...interface{})

func Info

func Info(args ...interface{})

func IsError

func IsError() bool

func IsInfo

func IsInfo() bool

func IsTrace

func IsTrace() bool

func IsVerbose

func IsVerbose() bool

func IsWarning

func IsWarning() bool

func Log

func Log(skipStackFrames int, level TLogLevel, args ...interface{})

func SetLogLevel

func SetLogLevel(logLevel TLogLevel)

func Trace

func Trace(args ...interface{})

func Verbose

func Verbose(args ...interface{})

func Warning

func Warning(args ...interface{})

Types

type TLogLevel

type TLogLevel int32

TLogLevel s.e.

Jump to

Keyboard shortcuts

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