log

package
v0.0.0-...-3e8b28a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushLogger

func FlushLogger(logger *zap.Logger)

FlushLogger writes any buffered log entries to the output. The function should be called before the program exits to ensure all logs are written.

func InitializeLogger

func InitializeLogger(logLevel zap.AtomicLevel, disableCaller bool, disableStacktrace bool) *zap.Logger

InitializeLogger initializes a new zap logger with the provided log level. The logger is configured to write JSON structured logs to stdout/stderr, with timestamps in RFC3339Nano format. Log example: {"level":"info","timestamp":"2021-08-25T14:00:00.000000000Z","message":"Fishman!"}

func UpdateLogLevel

func UpdateLogLevel(currentLevel zap.AtomicLevel, targetLevel string)

UpdateLogLevel changes the log level of the provided zap.AtomicLevel to the target level. If the target level string cannot be parsed, the function will silently fail.

Types

This section is empty.

Jump to

Keyboard shortcuts

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