logger

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logger a package for handling writing content to logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int8

LogLevel type definition of supported log levels.

const (
	// Trace level of logs.
	Trace LogLevel = iota - 2
	// Debug level of logs.
	Debug
	// Info level of logs.
	Info
	// Warning level of logs.
	Warning
	// Error level of logs.
	Error
)

type LogWriter

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

LogWriter the struct used for writing logs.

func CreateLogger

func CreateLogger(level LogLevel) *LogWriter

CreateLogger create the LogWriter struct with required content.

func (*LogWriter) LogDebug

func (logger *LogWriter) LogDebug(message string)

LogDebug write Debug level logs.

func (*LogWriter) LogDebugf

func (logger *LogWriter) LogDebugf(format string, a ...interface{})

LogDebugf write Debug level logs with formatting similar to fmt.Sprintf.

func (*LogWriter) LogError

func (logger *LogWriter) LogError(message string)

LogError write Error level logs.

func (*LogWriter) LogErrorf

func (logger *LogWriter) LogErrorf(format string, a ...interface{})

LogErrorf write Error level logs with formatting similar to fmt.Sprintf.

func (*LogWriter) LogInfo

func (logger *LogWriter) LogInfo(message string)

LogInfo write Info level logs.

func (*LogWriter) LogInfof

func (logger *LogWriter) LogInfof(format string, a ...interface{})

LogInfof write Info level logs with formatting similar to fmt.Sprintf.

func (*LogWriter) LogTrace

func (logger *LogWriter) LogTrace(message string)

LogTrace write Trace level logs.

func (*LogWriter) LogTracef

func (logger *LogWriter) LogTracef(format string, a ...interface{})

LogTracef write Trace level logs with formatting similar to fmt.Sprintf.

func (*LogWriter) LogWarning

func (logger *LogWriter) LogWarning(message string)

LogWarning write Warning level logs.

func (*LogWriter) LogWarningf

func (logger *LogWriter) LogWarningf(format string, a ...interface{})

LogWarningf write Warning level logs with formatting similar to fmt.Sprintf.

Jump to

Keyboard shortcuts

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