log

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const CODE_LOGGER_MODULE = "MODULE"
View Source
const LOG_PATH = "./.log"
View Source
const MODULE_CONSOLE = "CONSOLE"
View Source
const MODULE_FILE = "FILE"

Variables

This section is empty.

Functions

func Custom

func Custom(category string, message string)

func Custome

func Custome(category string, err error)

func Customf

func Customf(category string, format string, args ...any)

func Error

func Error(err error)

func Errorf

func Errorf(format string, args ...any)

func Errors

func Errors(message string)

func Message

func Message(message string)

func Messagef

func Messagef(format string, args ...any)

func Name

func Name() string

func Panic

func Panic(err error)

func Panicf

func Panicf(format string, args ...any)

func Panics

func Panics(message string)

func Warning

func Warning(message string)

func Warningf

func Warningf(format string, args ...any)

Types

type Category

type Category string
const (
	MESSAGE Category = "MESSAGE"
	WARNING Category = "WARNING"
	ERROR   Category = "ERROR"
	PANIC   Category = "PANIC"
)

type Formatter

type Formatter struct {
}

func (Formatter) Format

func (f Formatter) Format(record Record) string

type Log

type Log interface {
	Name() string
	Metadata() string
	Records() []Record
	Custom(string, string) *Record
	Custome(string, error) *Record
	Customf(string, string, ...any) *Record
	Message(string) *Record
	Messagef(string, ...any) *Record
	Warning(string) *Record
	Warningf(string, ...any) *Record
	Error(error) *Record
	Errors(string) *Record
	Errorf(string, ...any) *Record
	Panic(error)
	Panics(string)
	Panicf(string, ...any)
}

func ConfigureLog

func ConfigureLog(session string, timestamp int64, kargs map[string]utils.Argument) Log

type Module

type Module interface {
	Name() string
	Vector([]Record) []Record
	Record(*Record, bool) *Record
}

type Record

type Record struct {
	Category  Category `json:"category" bson:"category"`
	Message   string   `json:"message" bson:"message"`
	Timestamp int64    `json:"timestamp" bson:"timestamp"`
}

func Records

func Records() []Record

Jump to

Keyboard shortcuts

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