The MrAndreID/GoLog
package is a collection of functions in the go language for Log.
To use The MrAndreID/GoLog
package, you must follow the steps below:
go get -u github.com/MrAndreID/golog
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)
golog.Error("Andrea Adam")
Output:
2021-02-15 18:45:18 [ ERROR ] Andrea Adam
golog.Success("Andrea Adam")
Output:
2021-02-15 18:45:18 [ SUCCESS ] Andrea Adam
golog.Warning("Andrea Adam")
Output:
2021-02-15 18:45:18 [ WARNING ] Andrea Adam
golog.Info("Andrea Adam")
Output:
2021-02-15 18:45:18 [ INFO ] Andrea Adam
Full Example can be found on the Go Playground website.
I use SemVer for versioning. For the versions available, see the tags on this repository.
Andrea Adam - MrAndreID
MIT licensed. See the LICENSE file for details.
Documentation for Go Language can be found on the Go Language website.
Documentation can be found on https://go.dev/.