logger

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package Logger provides a singleton which allows consistent logging across the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *sypl.Sypl

Get returns logger. If logger isn't setup, it will exit with fatal.

func Setup

func Setup(o *Options) *sypl.Sypl

Setup logger. If it fails to setup, it will exit with fatal.

Types

type Options

type Options struct {
	// Allows to set the internal Logger. For now, it will be straightforward
	// Sypl logger. In the future, could be the `sypl.IBasicPrinter` interface.
	Logger *sypl.Sypl `json:"-"`

	FileLevel string `validate:"required,gte=3"`
	FilePath  string `validate:"required"`
	Level     string `validate:"required,gte=3"`
}

Options for logging .

func (*Options) Default

func (o *Options) Default()

Default sets `Options` default values.

type ProxyLogger added in v0.1.9

type ProxyLogger struct {
	Logger *sypl.Sypl
}

ProxyLogger exist to satisfy `goproxy` logging interface.

func (*ProxyLogger) Printf added in v0.1.9

func (pL *ProxyLogger) Printf(format string, v ...interface{})

Printf satisfies `goproxy` logging interface. Default logging level will be `Debug`.

Jump to

Keyboard shortcuts

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