log

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 3 Imported by: 13

README

Simple Log

Simple wrapper around zeroLog logger with simple interface

Exposes 3 log levels and returns an instance of a logger with set-able level and writer.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel string
const (
	DebugLvl LogLevel = "debug"
	InfoLvl  LogLevel = "info"
	ErrorLvl LogLevel = "error"
)

type Logger

type Logger struct {
	Loggeriface
	// contains filtered or unexported fields
}

func New

func New(writer io.Writer, lvl LogLevel) Logger

func (Logger) Debug

func (l Logger) Debug(msg string)

func (Logger) Debugf

func (l Logger) Debugf(format string, args ...any)

func (Logger) Error

func (l Logger) Error(err error)

func (Logger) Errorf

func (l Logger) Errorf(format string, args ...any)

func (Logger) Info

func (l Logger) Info(msg string)

func (Logger) Infof

func (l Logger) Infof(format string, args ...any)

type Loggeriface

type Loggeriface interface {
	Debugf(format string, args ...any)
	Debug(msg string)
	Infof(format string, args ...any)
	Info(msg string)
	Errorf(format string, args ...any)
	Error(err error)
}

Jump to

Keyboard shortcuts

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