golog

package module
v0.0.0-...-d507210 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 9 Imported by: 1

README

Aismail7 / Go Log

Go Reference

The Aismail7/GoLog package is a collection of functions in the go language for Log.


Table of Contents


Install

To use The Aismail7/GoLog package, you must follow the steps below:

go get -u github.com/Aismail7/golog

Usage

Init

To use Init Func., The Aismail7/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 (logLevel) are all, error, success, warning, & info. The first parameter (logLevel) is used for the log level to be stored in the log file. The second parameter is used to limit the number of log files created other than the day's log files.

golog.Init("all", 15)
Error
golog.Error("Ismail Ahmad")

Output:

2021-02-15 18:45:18 [ ERROR ] Ismail Ahmad
Success
golog.Success("Ismail Ahmad")

Output:

2021-02-15 18:45:18 [ SUCCESS ] Ismail Ahmad
Warning
golog.Warning("Ismail Ahmad")

Output:

2021-02-15 18:45:18 [ WARNING ] Ismail Ahmad
Info
golog.Info("Ismail Ahmad")

Output:

2021-02-15 18:45:18 [ INFO ] Ismail Ahmad

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

Ismail Ahmad - Aismail7

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/.

Documentation

Index

Constants

View Source
const (
	Reset = "\033[0m"

	PrimaryRed    = "\033[1;41m"
	PrimaryGreen  = "\033[1;42m"
	PrimaryYellow = "\033[1;43m"
	PrimaryCyan   = "\033[1;46m"

	SecondaryRed    = "\033[0;91m"
	SecondaryGreen  = "\033[0;92m"
	SecondaryYellow = "\033[0;93m"
	SecondaryCyan   = "\033[0;96m"
)

Variables

View Source
var (
	Limit                int
	LogLevel, LastUpdate string
)

Functions

func Error

func Error(message string)

func ExecutionLimit

func ExecutionLimit()

func Info

func Info(message string)

func Init

func Init(logLevel string, limit int)

func Success

func Success(message string)

func Warning

func Warning(message string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL