log

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package log provides structured logging for TerraCi CLI

Index

Constants

View Source
const (
	DebugLevel = log.DebugLevel
	InfoLevel  = log.InfoLevel
	WarnLevel  = log.WarnLevel
	ErrorLevel = log.ErrorLevel
	FatalLevel = log.FatalLevel
)

Log levels

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Debug logs a debug message

func Debugf

func Debugf(format string, args ...any)

Debugf logs a formatted debug message

func DecreasePadding

func DecreasePadding()

DecreasePadding decreases log output indentation

func Error

func Error(msg string)

Error logs an error message

func Errorf

func Errorf(format string, args ...any)

Errorf logs a formatted error message

func Fatal

func Fatal(msg string)

Fatal logs a fatal message and exits

func Fatalf

func Fatalf(format string, args ...any)

Fatalf logs a formatted fatal message and exits

func IncreasePadding

func IncreasePadding()

IncreasePadding increases log output indentation

func Info

func Info(msg string)

Info logs an info message

func Infof

func Infof(format string, args ...any)

Infof logs a formatted info message

func Init

func Init()

Init initializes the logger with default settings

func IsDebug

func IsDebug() bool

IsDebug returns true if debug level is enabled

func ResetPadding

func ResetPadding()

ResetPadding resets log output indentation

func SetLevel

func SetLevel(level Level)

SetLevel sets the global log level

func SetLevelFromString

func SetLevelFromString(level string) error

SetLevelFromString sets the log level from a string Supported values: debug, info, warn, error, fatal

func Warn

func Warn(msg string)

Warn logs a warning message

func Warnf

func Warnf(format string, args ...any)

Warnf logs a formatted warning message

func WithError

func WithError(err error) *log.Entry

WithError returns an entry with the given error

func WithField

func WithField(key string, value any) *log.Entry

WithField returns an entry with the given field

Types

type Level

type Level = log.Level

Level represents log severity

Jump to

Keyboard shortcuts

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