Help us shape the future of Go! Take the 2026 Go Developer Survey

go-logger

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0

README

go-logger

Build Status Go Report Card GoDoc Reference

This repository contains a small golang logger libary.

You can download the source via go.

go get github.com/volker-raschek/go-logger

Usage

package main

import (
  "github.com/volker-raschek/go-logger/pkg/logger"
)

func main() {
  myLogger := logger.NewDefaultLogger(logger.LogLevelDebug)
  myLogger.Debug("Debug output")
  myLogger.Info("Info output")
  myLogger.Warn("Warn output")
  myLogger.Error("Error output")
  myLogger.Fatal("Fatal output")
}

Produce the following output:

$ go run main.go
2019/09/24 15:25:34 DEBUG: Debug output
2019/09/24 15:25:34 INFO: Info output
2019/09/24 15:25:34 WARN: Warn output
2019/09/24 15:25:34 ERROR: Error output
2019/09/24 15:25:34 FATAL: Fatal output
exit status 1

If the function myLogger.Fatal() is called, the program is terminated with exit code 1.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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