Skip to content

Binalyze logger is an easily customizable wrapper for logrus with log rotation

Notifications You must be signed in to change notification settings

binalyze/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger

logger is an easily customizable wrapper for logrus with log rotation

Usage

There is only one function to initialize logger.

logger.Init()

When the logger package is initialized with logger.Init, user can log with the helper functions below.

// Get flag option values
logger.Debugf("%s","This is a debug log")
logger.Infof("%s","This is an info log")
logger.Warnf("%s","This is a warn log")
logger.Errorf("%s","This is an error log")
logger.Fatalf("%s","This is a fatal log")

Example log: ERROR 2021-01-26T14:37:17+03:00 1.0.0 Test logging main.go:25

Level

Logger package default log level is Info. If Debug logging is enabled, then all the levels will be logged. You can set log level to Debug with the helper below:

logger.SetDebugLogging(true)

About

Binalyze logger is an easily customizable wrapper for logrus with log rotation

Topics

Resources

Stars

Watchers

Forks

Languages