windowseventlog

package module
v0.0.0-...-aff44bd Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

WindowsEventLog

windows event log implementation for go-micro meta logger.

Usage

Before the first use, it is necessary to initialize the registrar with administrator rights.

The NewLogger function tries to create an event source named src in the options (or by default), but this may not happen, so for proper initialization it is recommended to use the Init function, which returns an error.

func Init() {
  l := windowseventlog.NewLogger(windowseventlog.WithSrc("test src"), logger.WithEid(1000))
  err := l.Init()
  if err != nil {
      //smt
  }
}
func Example() {
  logger.DefaultLogger = windowseventlog.NewLogger(windowseventlog.WithSrc("test src"), logger.WithEid(1000))

  logger.Infof(logger.InfoLevel, "testing: %s", "Infof")

}

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(opts ...logger.Option) *eventLogger

func WithEid

func WithEid(neweid uint32) logger.Option

func WithSrc

func WithSrc(namesrc string) logger.Option

Types

type Options

type Options struct {
	logger.Options
	Src string
	Eid uint32
}

Jump to

Keyboard shortcuts

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