logger

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package logger provides a small structured logger with flag-based level, output, and timezone settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(msg string, kv ...any)

Error logs an error-level message.

func ErrorSkipframes

func ErrorSkipframes(skipframes int, msg string, kv ...any)

ErrorSkipframes logs error message and skips the given number of frames for the caller.

func Fatal

func Fatal(msg string, kv ...any)

Fatal logs a fatal-level message and exits the process.

func FatalSkipframes

func FatalSkipframes(skipframes int, msg string, kv ...any)

FatalSkipframes logs fatal message and terminates the app.

func Info

func Info(msg string, kv ...any)

Info logs an info-level message.

func InfoSkipframes

func InfoSkipframes(skipframes int, msg string, kv ...any)

InfoSkipframes logs info message and skips the given number of frames for the caller.

func Init

func Init()

Init applies logger flags. Call it after flag parsing.

func Panic

func Panic(msg string, kv ...any)

Panic logs a panic-level message and panics.

func PanicSkipframes

func PanicSkipframes(skipframes int, msg string, kv ...any)

PanicSkipframes logs panic message and panics.

func ResetOutput

func ResetOutput()

ResetOutput restores stdout as the logger output writer.

func SetOutput

func SetOutput(w io.Writer)

SetOutput changes the logger output writer.

func StdErrorLogger

func StdErrorLogger() *log.Logger

StdErrorLogger returns a stdlib logger that writes through Error.

func Warn

func Warn(msg string, kv ...any)

Warn logs a warning-level message.

func WarnSkipframes

func WarnSkipframes(skipframes int, msg string, kv ...any)

WarnSkipframes logs warn message and skips the given number of frames for the caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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