Skip to content
/ logger Public
forked from pravinba9495/logger

A minimalisitic logger module for basic logging, written in Go

License

Notifications You must be signed in to change notification settings

aheeva/logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger

Go Reference Go Report Card Issues License Release

A minimalisitic logger module for basic logging, written in Go.

Table of Contents

Example

Client

package main

import (
    "github.com/aheeva/logger"
)

func main() {
    // Initialize logger
    opts := &logger.LoggerOptions{
	LogLevel:    logger.LevelTrace,
	LogFilePath: "logfile.txt",
    }
    close, err := logger.Init(opts)
    if err != nil {
        panic(err)
    }
    defer close()

    logger.Trace("This is just a trace");            // Prints on stdout with a cyan colored text
    logger.Print("This is just a simple log");       // Prints on stdout with a white colored text
    logger.Warn("This is just a warning log");       // Prints on stdout with a yellow colored text
    logger.Success("This is just a success log");    // Prints on stdout with a green colored text
    logger.Error("This is just an error log");       // Prints on stdout with a red colored text
}

Documentation

Logger documentation is hosted at Read the docs.

Development

Logger is still under development. Contributions are always welcome!

Maintainers

License

MIT