You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Markus Pesch efc69ecf95
fix: README, go get command
6 months ago
.drone.yml fix: migrate to gitea 10 months ago
.editorconfig Intial Commit 1 year ago
.gitattributes Intial Commit 1 year ago
.gitignore fix: migrate to gitea 10 months ago
LICENSE add: LICENSE 1 year ago
Makefile fix: migrate to gitea 10 months ago
README.md fix: README, go get command 6 months ago
go.mod fix: migrate to gitea 10 months ago
go.sum fix: migrate to gitea 10 months ago
logger.go fix: migrate to gitea 10 months ago
logger_test.go fix: migrate to gitea 10 months ago

README.md

go-logger

Build Status

This repository contains a small golang logger libary.

You can download the source via go.

go get git.cryptic.systems/volker.raschek/go-logger

Usage

package main

import (
  "git.cryptic.systems/volker.raschek/go-logger"
)

func main() {
  myLogger := logger.NewLogger(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.