A golang logging library made for simplicity
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
console
example
file
.gitignore
.travis.yml
LICENSE
Makefile
README.md
logger.go

README.md

Glog - a golang logging library made for simplicity

Build Status codecov Go Report Card

This is currently WIP

Look at ./example for what it is doing.

// Package main provides ...
package main

import (
	"github.com/mstruebing/glog"
	"github.com/mstruebing/glog/console"
	"github.com/mstruebing/glog/file"
	"os"
)

func main() {
	stderrLogger := console.StderrLogger()
	stderrLogger.Println("This logs to stderr")

	stdoutLogger := console.StdoutLogger()
	stdoutLogger.Println("This logs to stdout")

	fileLogger := file.Logger{Target: "/tmp/mystuff.txt"}
	fileLogger.Println("This logs to a file")

	genericLogger := glog.Logger{Target: os.Stdout}
	genericLogger.Println("Logs to stdout from genericLogger")
}