slf4go_zap_adaptor

package module
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: MIT Imports: 4 Imported by: 1

README

Go Report Card Coverage Status Build Status

Zap adaptor for SLF4GO

This is a zap adaptor implementation for SLF4GO.

An example usage is stupid simple:


package main

import "github.com/aellwein/slf4go"
import _ "github.com/aellwein/slf4go-zap-adaptor"

func main() {
	slf4go.GetLoggerFactory().SetLoggingParameters(slf4go.LoggingParameters{
		"development": true,
	})

	logger := slf4go.GetLogger("example")
	logger.Info("this is just an example.")
	logger.Warn("Don't take it too serious.")
}

Note the underscore in front of the import of the SLF4GO adaptor.

You can change the logger implementation anytime, without changing the facade you are using, only by changing the imported adaptor.

Logging parameters

This adaptor supports several parameters, available with SetLoggingParameters:

Parameter Key Value Type Description
"development" bool true, if development logging should be used
"options" []zap.Option Arbitrary options to pass to the logger factory
"fields" []zap.Field Fields to be included

Development

  • use go build ./... as usual.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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