Logger is a basic logging library that could be used in API logging and any other code where terminal and file logging is required.
Simply run the following command to get the logger package.
go get github.com/rashintha/logger
Logger will create log/log.log
file in your app's root directory and will print the log to your terminal as well as to the log file.
package main
import "github.com/rashintha/logger"
func main() {
// Default log
logger.Defaultln("Default log line")
logger.Defaultf("Default log line with %v", "parameters")
// Information log
logger.Infoln("Information log line")
logger.Infof("Information log line with %v", "parameters")
// Warning log
logger.Warningln("Warning log line")
logger.Warningf("Warning log line with %v", "variables")
// Error log
logger.Errorln("Error log line")
logger.Errorf("Error log line with %v", "parameters")
logger.ErrorFatal("Fatal error log line")
logger.ErrorFatalf("Fatal error log line with %v", "parameters")
}
Logger is released under Apache-2.0 license. Please read LICENSE for more information.
I always appreciate help from the community to develop. Please send me an email to mail@rashintha.com to get started!