go-logging

module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: GPL-2.0

README

Golang logging package

Go Reference Build Status

This logging package is a wrapper around the standard library's log package, giving you abstractions for logging at different levels.

Installation

  go get github.com/shuvava/go-logging@v1.0.6

Usage

package main

import (
	"github.com/shuvava/go-logging/logger"
	"github.com/sirupsen/logrus"
)

func main() {
	log := logger.NewLogrusLogger(logrus.DebugLevel)
	log.Trace("Something very low level.")
	log.Debug("Useful debugging information.")
	log.Info("Something noteworthy happened!")
	log.Warn("You should probably take a look at this.")
	log.Error("Something failed but I'm not quitting.")
	// Calls os.Exit(1) after logging
	log.Fatal("Bye.")
}

Directories

Path Synopsis
cmd
Package logger is abstraction over logger implementation
Package logger is abstraction over logger implementation

Jump to

Keyboard shortcuts

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