logx

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 4 Imported by: 0

README

go-logx

Just a simple logging utility that i use in some of my proejcts. You are more than welcome to use it or if you want to change something would be happy to review a PR if you want something added.

Installation

go get github.com/Reinami/go-logx@latest

Usage

func main() {
	logger := slog.New(&logx.ColorLogger{})
	slog.SetDefault(logger)

    slog.Error("some error occured")
}

Documentation

Index

Constants

View Source
const (
	COLOR_RESET  = "\033[0m"
	COLOR_RED    = "\033[31m"
	COLOR_YELLOW = "\033[33m"
	COLOR_GREEN  = "\033[32m"
	COLOR_BLUE   = "\033[34m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorLogger

type ColorLogger struct{}

func (*ColorLogger) Enabled

func (c *ColorLogger) Enabled(_ context.Context, _ slog.Level) bool

func (*ColorLogger) Handle

func (c *ColorLogger) Handle(_ context.Context, r slog.Record) error

func (*ColorLogger) WithAttrs

func (c *ColorLogger) WithAttrs(_ []slog.Attr) slog.Handler

func (*ColorLogger) WithGroup

func (c *ColorLogger) WithGroup(_ string) slog.Handler

Jump to

Keyboard shortcuts

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