MrAndreID / Go Log

The MrAndreID/GoLog package is a collection of functions in the go language for Log.
Table of Contents
Install
To use The MrAndreID/GoLog package, you must follow the steps below:
go get -u github.com/MrAndreID/golog
Usage
Init
To use Init Func., The MrAndreID/GoLog package will add/modify .gitignore file and add logs/ and the last one will create a logs folder. Inside the logs folder will contain the log files based on the log file creation date. The contents of the first parameter is used to limit the number of log files created other than the day's log files. The second parameter (logLevel) are all, error, success, warning, & info. The second parameter (logLevel) is used for the log level to be stored in the log file. The third parameter (timezone) is used to set the time zone used. The fourth parameter (style) is used to set the style. Style is to add color.
golog.Init(30, "all", "Asia/Jakarta", false)
Error
golog.Error("Andrea Adam")
Output:
2021-02-15 18:45:18 [ ERROR ] Andrea Adam
Success
golog.Success("Andrea Adam")
Output:
2021-02-15 18:45:18 [ SUCCESS ] Andrea Adam
Warning
golog.Warning("Andrea Adam")
Output:
2021-02-15 18:45:18 [ WARNING ] Andrea Adam
Info
golog.Info("Andrea Adam")
Output:
2021-02-15 18:45:18 [ INFO ] Andrea Adam
Full Example
Full Example can be found on the Go Playground website.
Versioning
I use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
Andrea Adam - MrAndreID
License
MIT licensed. See the LICENSE file for details.
Official Documentation for Go Language
Documentation for Go Language can be found on the Go Language website.
More
Documentation can be found on https://go.dev/.