Skip to content

iooojik/go-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library for logging

Using

package main

import "github.com/iooojik/go-logger"

func main() {
	logger.WriteLogsToFile(true, "./log.txt")
	logger.LogInfo("hello world!")
	logger.LogDebug("hello world!")
	logger.LogError("hello world!")
}

Methods

Write logs to a file

logger.WriteLogsToFile(logPath string)

Log without highlighting

logger.LogInfo(msg any)

Log with green highlighting

logger.LogPositive(msg any)

Log with yellow highlighting

logger.LogDebug(msg any)

Log errors

logger.LogError(msg any)