Documentation ¶
Index ¶
- Constants
- Variables
- func DebugWriter() *levelWriter
- func DualLogger(conf LoggerConfig, wg *sync.WaitGroup, exFn *func()) *dualLogger
- func ErrorWriter() *levelWriter
- func FatalWriter() *levelWriter
- func InfoWriter() *levelWriter
- func Init(loggerConfig LoggerConfig) error
- func InitWithWaitGroupAndExitingFunc(wg *sync.WaitGroup, exitFunc *func(), loggerConfig LoggerConfig) error
- func LastWord(v ...interface{})
- func NewCustomWriter(prefix string, suffix string) *customWriter
- func WarningWriter() *levelWriter
- type Logger
- type LoggerConfig
Constants ¶
View Source
const ( LvlNull uint8 = iota LvlFatal LvlError LvlWarning LvlInfo LvlDebug )
Variables ¶
View Source
var ( Debug = func(...interface{}) {} // Trivial and aligning with best practices Info = func(...interface{}) {} // Non-trivial and aligning with best practices Warning = func(...interface{}) {} // Non-trivial and not aligning with best practices Error = func(...interface{}) {} // Important and not in good condition, system can keep up Fatal = func(...interface{}) {} // Important and not in good condition, system can't keep up )
View Source
var (
ErrBadLoggingLvl error = errors.New("internal/logger.Init(): invalid logLevel")
)
Functions ¶
func DebugWriter ¶
func DebugWriter() *levelWriter
func DualLogger ¶
func DualLogger(conf LoggerConfig, wg *sync.WaitGroup, exFn *func()) *dualLogger
func ErrorWriter ¶
func ErrorWriter() *levelWriter
func FatalWriter ¶
func FatalWriter() *levelWriter
func InfoWriter ¶
func InfoWriter() *levelWriter
func Init ¶
func Init(loggerConfig LoggerConfig) error
func InitWithWaitGroupAndExitingFunc ¶
func InitWithWaitGroupAndExitingFunc(wg *sync.WaitGroup, exitFunc *func(), loggerConfig LoggerConfig) error
func LastWord ¶
func LastWord(v ...interface{})
LastWord() blocks and is only used for CLEAN, INTENDED EXITING. calling LastWord() does not invoke exitingFunc() caller should make sure the system is in a CLEAN state which exit(0) could be invoked without breaking any other systems.
func NewCustomWriter ¶
func WarningWriter ¶
func WarningWriter() *levelWriter
Types ¶
type LoggerConfig ¶
Click to show internal directories.
Click to hide internal directories.