Documentation
¶
Index ¶
- Constants
- func Cleanup()
- func ConfigureLogger(level string, toStdout bool) error
- func ConfigureLogging(config LogConfig) error
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func FormatOrgID(orgID string) string
- func FormatSiteID(siteID string) string
- func GetLogLevelFromString(level string) logrus.Level
- func GetLogger() *logrus.Logger
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func SetLogger(logger *logrus.Logger) *logrus.Logger
- func SetOrgNameLookupFunc(fn OrgNameLookupFunc)
- func SetSiteNameLookupFunc(fn SiteNameLookupFunc)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type LogConfig
- type OrgNameLookupFunc
- type SiteNameLookupFunc
Constants ¶
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 ConfigureLogger ¶
ConfigureLogger configures the logger with a simplified interface This is an alias for ConfigureLogging to maintain backward compatibility with existing code
func ConfigureLogging ¶
ConfigureLogging configures the logging system according to the given configuration This is the main entry point for setting up logging in the application
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a formatted message at the debug 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 ¶
FormatOrgID formats an organization ID with its name if available
func FormatSiteID ¶
FormatSiteID formats a site ID with its name if available
func GetLogLevelFromString ¶
GetLogLevelFromString converts a string level to a logrus.Level
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a formatted message at the info level
func SetLogger ¶
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
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 ¶
OrgNameLookupFunc is a function type for looking up organization names from org IDs
type SiteNameLookupFunc ¶
SiteNameLookupFunc is a function type for looking up site names from site IDs