log

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 3 Imported by: 4

Documentation

Overview

Package log implements a logger interface that can be used within the go-mail package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level is a type wrapper for an int

const (
	// LevelError is the Level for only ERROR log messages
	LevelError Level = iota
	// LevelWarn is the Level for WARN and higher log messages
	LevelWarn
	// LevelInfo is the Level for INFO and higher log messages
	LevelInfo
	// LevelDebug is the Level for DEBUG and higher log messages
	LevelDebug
)

type Logger

type Logger interface {
	Errorf(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Debugf(format string, v ...interface{})
}

Logger is the log interface for go-mail

type Stdlog

type Stdlog struct {
	// contains filtered or unexported fields
}

Stdlog is the default logger that satisfies the Logger interface

func New

func New(o io.Writer, l Level) *Stdlog

New returns a new Stdlog type that satisfies the Logger interface

func (*Stdlog) Debugf

func (l *Stdlog) Debugf(f string, v ...interface{})

Debugf performs a Printf() on the debug logger

func (*Stdlog) Errorf

func (l *Stdlog) Errorf(f string, v ...interface{})

Errorf performs a Printf() on the error logger

func (*Stdlog) Infof

func (l *Stdlog) Infof(f string, v ...interface{})

Infof performs a Printf() on the info logger

func (*Stdlog) Warnf

func (l *Stdlog) Warnf(f string, v ...interface{})

Warnf performs a Printf() on the warn logger

Jump to

Keyboard shortcuts

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