log

package module
v0.0.0-...-5452d80 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 5 Imported by: 0

README

github.com/apenella/go-common-utils/logger

Logger package is no longer maintained because there is many other alternatives that solve the logging in a better way. Some of those alternatives are Logrus, Zerolog or Zap.

Documentation

Index

Constants

View Source
const (
	ERROR int8 = iota
	WARN
	INFO
	DEBUG

	TAB int8 = iota
	JSON

	TabFormat             = "%s	%s	%s"
	JsonFormat            = "{\"timestamp\": \"%s\", \"level\": \"%s\", \"message\": \"%s\"}"
	TimestampLayoutFormat = "2006-01-02 15:04:00"
)

Constants definitions

Variables

This section is empty.

Functions

func Reset

func Reset() error

func StopLog

func StopLog()

Types

type Log

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

func GetLog

func GetLog() *Log

func (*Log) Debug

func (l *Log) Debug(m ...interface{})

func (*Log) Error

func (l *Log) Error(m ...interface{})

func (*Log) Info

func (l *Log) Info(m ...interface{})

func (*Log) SetFormat

func (l *Log) SetFormat(format int8) error

func (*Log) SetLayout

func (l *Log) SetLayout(layout string) error

func (*Log) SetLevel

func (l *Log) SetLevel(level int8) error

func (*Log) SetWriter

func (l *Log) SetWriter(writer io.Writer) error

func (*Log) Warn

func (l *Log) Warn(m ...interface{})

type MockWriter

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

MockWrite implements io.Writer and is used to test messageOutput

func (*MockWriter) Read

func (m *MockWriter) Read(p []byte) (n int, err error)

Read implementation

func (*MockWriter) Write

func (m *MockWriter) Write(p []byte) (n int, err error)

Writes implementation

Jump to

Keyboard shortcuts

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