logger

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package logger provides logging configuration and access for the CLI.

This package wraps logrus to provide consistent logging across the CLI. It supports configurable log levels and JSON output format for machine parsing.

Setup

Call Setup early in the application lifecycle:

logger.Setup("debug", false) // debug level, text format
logger.Setup("info", true)   // info level, JSON format

Usage

log := logger.GetLogger()
log.Debug("detailed information")
log.Info("general information")
log.Error("error occurred")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger() *logrus.Logger

GetLogger returns the global logger instance. The logger should be configured via Setup before use. This returns the logrus standard logger which can be used for Debug, Info, Warn, Error, Fatal, and Panic level logging.

func Setup

func Setup(level string, jsonFormat bool)

Setup configures the global logger with the specified level and format. Valid log levels are: debug, info, warn, error, fatal, panic. If an invalid level is provided, it defaults to info. When jsonFormat is true, logs are output as JSON for machine parsing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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