logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Log format types
	FormatText = "text"
	FormatJSON = "json"

	// Environment variable names
	EnvLogLevel  = "MIST_CLI_LOG_LEVEL"
	EnvLogFormat = "MIST_CLI_LOG_FORMAT"
)

Logger configuration constants

Variables

This section is empty.

Functions

func Cleanup

func Cleanup()

Cleanup closes log files and performs any necessary cleanup

func ConfigureLogger

func ConfigureLogger(level string, toStdout bool) error

ConfigureLogger configures the logger with a simplified interface This is an alias for ConfigureLogging to maintain backward compatibility with existing code

func ConfigureLogging

func ConfigureLogging(config LogConfig) error

ConfigureLogging configures the logging system according to the given configuration This is the main entry point for setting up logging in the application

func Debug

func Debug(args ...interface{})

Debug logs a message at the debug level

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a formatted message at the debug level

func Error

func Error(args ...interface{})

Error logs a message at the error level

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs a formatted message at the error level

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a formatted message at the fatal level and then calls os.Exit(1)

func FormatOrgID

func FormatOrgID(orgID string) string

FormatOrgID formats an organization ID with its name if available

func FormatSiteID

func FormatSiteID(siteID string) string

FormatSiteID formats a site ID with its name if available

func GetLogLevelFromString

func GetLogLevelFromString(level string) logrus.Level

GetLogLevelFromString converts a string level to a logrus.Level

func GetLogger

func GetLogger() *logrus.Logger

GetLogger returns the default logger

func Info

func Info(args ...interface{})

Info logs a message at the info level

func Infof

func Infof(format string, args ...interface{})

Infof logs a formatted message at the info level

func SetLogger

func SetLogger(logger *logrus.Logger) *logrus.Logger

SetLogger sets the default logger to a provided logger instance This is primarily used for testing

func SetOrgNameLookupFunc

func SetOrgNameLookupFunc(fn OrgNameLookupFunc)

SetOrgNameLookupFunc sets the function to be used for organization name lookups

func SetSiteNameLookupFunc

func SetSiteNameLookupFunc(fn SiteNameLookupFunc)

SetSiteNameLookupFunc sets the function to be used for site name lookups

func Warn

func Warn(args ...interface{})

Warn logs a message at the warn level

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a formatted message at the warn level

Types

type LogConfig

type LogConfig struct {
	Enable   bool   // logging enabled
	Level    string // debug, info, warn, or error
	Format   string // text or json
	ToStdout bool   // also log to stdout
	LogFile  string // path to log file (empty = no file logging)
	Silent   bool   // suppress logging destination message
}

LogConfig represents logging configuration settings.

type OrgNameLookupFunc

type OrgNameLookupFunc func(orgID string) (string, bool)

OrgNameLookupFunc is a function type for looking up organization names from org IDs

type SiteNameLookupFunc

type SiteNameLookupFunc func(siteID string) (string, bool)

SiteNameLookupFunc is a function type for looking up site names from site IDs

Jump to

Keyboard shortcuts

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