logging

package
v0.0.0-...-b84e678 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CYAN = "\033[96m"
View Source
const DEBUG_LOG_LEVEL = 3
View Source
const END = "\033[0m"
View Source
const ERROR_LOG_LEVEL = 0
View Source
const GRAY = "\033[90m"
View Source
const GREEN = "\033[92m"
View Source
const INFO_LOG_LEVEL = 2
View Source
const MAGENTA = "\033[95m"
View Source
const RED = "\033[91m"
View Source
const RESULT_LOG_LEVEL = 4
View Source
const WARNING_LOG_LEVEL = 1
View Source
const YELLOW = "\033[93m"

Variables

View Source
var GLOBAL_LOG_LEVEL = -1

Functions

func Configure

func Configure(config Config) error

func LevelLabel

func LevelLabel(level int) string

func Log

func Log(currentLogLevel int, message string, options ...LogOptions)

func LogInit

func LogInit(globalLogLevel ...int)

func ParseLevel

func ParseLevel(s string) (int, error)

func ReadLast

func ReadLast(n int) ([]string, error)

func SetGlobalLevel

func SetGlobalLevel(level int) error

Types

type Config

type Config struct {
	Dir          string
	WriteConsole bool
	WriteFile    bool
	Retention    int
}

type LogOptions

type LogOptions struct {
	Params       map[string]any
	Override     bool
	WriteConsole *bool
	WriteFile    *bool
}

Jump to

Keyboard shortcuts

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