iLooger is logger library for DE-labtory project.
You don't need to set complicated logeer. Just Import this pckage and Write log.
go get -u github.com/DE-labtory/iLogger
dep ensure
package main
import "github.com/DE-labtory/iLogger"
func main() {
iLogger.Infof(nil, "This is Info log")
iLogger.Warnf(nil, "This is Warn log")
iLogger.SetToDebug() // Would you use Debug logger? You should set debug state.
iLogger.Debugf(nil, "This is Debug log")
iLogger.Errorf(nil, "This is Error log")
iLogger.Fatalf(nil, "This is Fatal log")
iLogger.Panicf(nil, "This is Panic log")
}
- Info
- Warn
- Debug
- Error
- Fatal
- Panic
package main
import "github.com/DE-labtory/iLogger"
func main() {
iLogger.EnableFileLogger(true, "./mylog.log")
iLogger.Infof(nil, "This is Info log")
iLogger.Warnf(nil, "This is Warn log")
}
You can write log to certain file path by calling EnableFileLogger function.
package main
import "github.com/DE-labtory/iLogger"
func main() {
iLogger.Info(nil, "This is Info log")
iLogger.Infof(nil, "This is Infof log. %s", "This can use variadic arguments")
}
Funcfion named aftet 'f' is for variadic arguments.
You can call the others level named after 'f'.