config

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Version:             1,
	Skip:                ptr([]string{}),
	Keep:                ptr([]string{}),
	TimeFields:          ptr([]string{"time", "ts", "@timestamp", "timestamp", "Timestamp"}),
	MessageFields:       ptr([]string{"message", "msg", "Body"}),
	LevelFields:         ptr([]string{"level", "lvl", "loglevel", "severity", "SeverityText"}),
	SortLongest:         ptr(true),
	SkipUnchanged:       ptr(true),
	Truncates:           ptr(true),
	LightBg:             ptr(false),
	ColorMode:           ptr("auto"),
	TruncateLength:      ptr(15),
	TimeFormat:          ptr(time.Stamp),
	Interrupt:           ptr(false),
	SkipCheckForUpdates: ptr(false),
	Palette:             nil,
}

Functions

func GetDefaultConfigFilepath

func GetDefaultConfigFilepath() (string, error)

Types

type ColorMode

type ColorMode int
const (
	ColorModeOff ColorMode = iota
	ColorModeOn
	ColorModeAuto
)

func GrokColorMode

func GrokColorMode(colorMode string) (ColorMode, error)

type Config

type Config struct {
	Version             int          `json:"version"`
	Skip                *[]string    `json:"skip"`
	Keep                *[]string    `json:"keep"`
	TimeFields          *[]string    `json:"time-fields"`
	MessageFields       *[]string    `json:"message-fields"`
	LevelFields         *[]string    `json:"level-fields"`
	SortLongest         *bool        `json:"sort-longest"`
	SkipUnchanged       *bool        `json:"skip-unchanged"`
	Truncates           *bool        `json:"truncates"`
	LightBg             *bool        `json:"light-bg"`
	ColorMode           *string      `json:"color-mode"`
	TruncateLength      *int         `json:"truncate-length"`
	TimeFormat          *string      `json:"time-format"`
	TimeZone            *string      `json:"time-zone"`
	Palette             *TextPalette `json:"palette"`
	Interrupt           *bool        `json:"interrupt"`
	SkipCheckForUpdates *bool        `json:"skip_check_updates"`

	ExperimentalFeatures *Features `json:"experimental_features"`
}

func ReadConfigFile

func ReadConfigFile(path string, dflt *Config) (*Config, error)

type Features added in v0.7.7

type Features struct {
	ReleaseChannel       *string `json:"release_channel"`
	SendLogsToCloud      *bool   `json:"send_logs_to_cloud"`
	ServeLocalhostOnPort *int    `json:"serve_localhost_on_port"`
}

type TextPalette

type TextPalette struct {
	KeyColor              []string `json:"key"`
	ValColor              []string `json:"val"`
	TimeLightBgColor      []string `json:"time_light_bg"`
	TimeDarkBgColor       []string `json:"time_dark_bg"`
	MsgLightBgColor       []string `json:"msg_light_bg"`
	MsgAbsentLightBgColor []string `json:"msg_absent_light_bg"`
	MsgDarkBgColor        []string `json:"msg_dark_bg"`
	MsgAbsentDarkBgColor  []string `json:"msg_absent_dark_bg"`
	DebugLevelColor       []string `json:"debug_level"`
	InfoLevelColor        []string `json:"info_level"`
	WarnLevelColor        []string `json:"warn_level"`
	ErrorLevelColor       []string `json:"error_level"`
	PanicLevelColor       []string `json:"panic_level"`
	FatalLevelColor       []string `json:"fatal_level"`
	UnknownLevelColor     []string `json:"unknown_level"`
}

Jump to

Keyboard shortcuts

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