logger

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, param ...any)

Debug will log the message with Println and then continue

func Fatal

func Fatal(ctx context.Context, param ...any)

Fatal will log the message with Println and call os.Exit is in background

func Info

func Info(ctx context.Context, param ...any)

Info will log the message with Println and then continue

func Panic

func Panic(ctx context.Context, param ...any)

Panic will log the message with Println and then call panic()

func SetDumpSkipLines

func SetDumpSkipLines(lines int)

func SetLevel

func SetLevel(level string)

SetLevel set an error reporting level. The logger will process messages of this level and higher.

func SetOutput

func SetOutput(filePath string)

SetOutput accepts: stdout, stderr, or a filePath

func Warn

func Warn(ctx context.Context, param ...any)

Warn will log the message with Println and then continue

Types

type LogLevel

type LogLevel int
const (
	LOGWARN LogLevel = iota + 3
	LOGINFO
	LOGDEBUG
)

type Status

type Status struct {
	Message string `json:"message"`
	Status  int    `json:"status"`
	Err     string `json:"error,omitempty"`
	Request string `json:"request"`
	Trace   string `json:"trace,omitempty"`
}

func Error

func Error(ctx context.Context, http int, err error, param ...any) *Status

func ErrorNoErr

func ErrorNoErr(ctx context.Context, http int, param ...any) *Status

func ExecError

func ExecError(ctx context.Context, http int, stderr string, param ...any) *Status

func (*Status) Error

func (e *Status) Error() string

Status implements the Error interface

func (*Status) String

func (e *Status) String() string

Status implements the Stringer interface Using fmt package here caused stack overflow

Jump to

Keyboard shortcuts

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