logging

package
v0.0.0-...-bdd342a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFileStream

func CreateFileStream(filePath string) (*os.File, error)

Create file stream. Output log to file stream. if you wanna output default filepath, please set "" to argument.

func OpenEnv

func OpenEnv()

Types

type Level

type Level int
const (
	DEBUG Level = iota
	INFO
	WARNING
	ERROR
	CRITICAL
)

func ConvertLevel

func ConvertLevel(levelStr string) (Level, error)

func (Level) String

func (level Level) String() string

type Logger

type Logger struct {
	Logger    []log.Logger
	LogLevel  Level
	LogFormat string
}

func New

func New(streams []io.Writer) *Logger

Logger initialize any writer.

func (*Logger) Critical

func (l *Logger) Critical(msg string)

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Warning

func (l *Logger) Warning(msg string)

Jump to

Keyboard shortcuts

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