Skip to content

A Minimalistic Golang logger that logs to stdout and file with support for Log Levels.

License

Notifications You must be signed in to change notification settings

divineslight/golanglog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoLangLog

Minimalistic Golang logger that logs to stdout and files.

Installation

go get github.com/munirehmad/golanglog

Usage

package main

import (
    "github.com/munirehmad/golanglog"
)
  
func main(){
    log := golanglog.NewLogger("./logs/main.log", true)

    /* Available Logging Levels are
    LDebug
    LInfo
    LWarn
    LError
    LFatal*/
    
    log.Level = golanglog.LInfo

    // This will be ignored because log level is set at Info`
    log.Debug("This is debug", 1, true, log)

    log.Info("And this is info", 1)
    
    /* Available Logging functions are
    log.Debug
    log.Info
    log.Warn
    log.Error
    log.Fatal // This kills the execution with panic()*/
}

About

A Minimalistic Golang logger that logs to stdout and file with support for Log Levels.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages