hieda_yamlutil

package module
v0.0.0-...-c2545e8 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultConfigSampel = `` /* 4018-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonLogConfigYAML

type CommonLogConfigYAML struct {
	Enable   bool                                   `yaml:"enable"`
	Backends map[string]CommonLogConfigYAML_Backend `yaml:"backends"`
}

type CommonLogConfigYAML_BKE_AliSLS

type CommonLogConfigYAML_BKE_AliSLS struct {
	EnableAliSLSProducerDebug bool                                      `yaml:"alisls_producer_debug"`
	Hostname                  string                                    `yaml:"hostname"`
	AppName                   string                                    `yaml:"appname"`
	Appkey                    string                                    `yaml:"ak_id"`
	Secret                    string                                    `yaml:"ak_secret"`
	Endpoint                  string                                    `yaml:"endpoint"`
	Project                   string                                    `yaml:"project"`
	Logstore                  string                                    `yaml:"logstore"`
	Topic                     string                                    `yaml:"topic"`
	EmitIP                    string                                    `yaml:"emit_ip"`
	OverrideWithRealIP        bool                                      `yaml:"override_with_real_ip"`
	ExtendAliSLSConfig        *CommonLogConfigYAML_BKE_AliSLS_ExtendCfg `yaml:"extend_alisls_config"`
}

type CommonLogConfigYAML_BKE_AliSLS_ExtendCfg

type CommonLogConfigYAML_BKE_AliSLS_ExtendCfg struct {
	TotalSizeLnBytes      int64  `yaml:"total_size_ln_bytes"`
	MaxIoWorkerCount      int64  `yaml:"max_io_worker_count"`
	MaxBlockSec           int    `yaml:"max_block_sec"`
	MaxBatchSize          int64  `yaml:"max_batch_size"`
	MaxBatchCount         int    `yaml:"max_batch_count"`
	LingerMs              int64  `yaml:"linger_ms"`
	Retries               int    `yaml:"retries"`
	MaxReservedAttempts   int    `yaml:"max_reserved_attempts"`
	BaseRetryBackoffMs    int64  `yaml:"base_retry_backoff_ms"`
	MaxRetryBackoffMs     int64  `yaml:"max_retry_backoff_ms"`
	AdjustShargHash       bool   `yaml:"adjust_sharg_hash"`
	Buckets               int    `yaml:"buckets"`
	AllowLogLevel         string `yaml:"allow_log_level"`
	LogFileName           string `yaml:"log_file_name"`
	IsJsonType            bool   `yaml:"is_json_type"`
	LogMaxSize            int    `yaml:"log_max_size"`
	LogMaxBackups         int    `yaml:"log_max_backups"`
	LogCompress           bool   `yaml:"log_compress"`
	NoRetryStatusCodeList []int  `yaml:"no_retry_status_code_list"`
}

type CommonLogConfigYAML_BKE_Console

type CommonLogConfigYAML_BKE_Console struct {
	To string `yaml:"to"`
}

type CommonLogConfigYAML_BKE_File

type CommonLogConfigYAML_BKE_File struct {
	Filename     string                                     `yaml:"filename"`
	FVConsole    bool                                       `yaml:"fvconsole"`
	Rotate       bool                                       `yaml:"rotate"`
	RotateConfig *CommonLogConfigYAML_BKE_File_RotateConfig `yaml:"rotate_config"`
}

type CommonLogConfigYAML_BKE_File_RotateConfig

type CommonLogConfigYAML_BKE_File_RotateConfig struct {
	MaxSize    int  `yaml:"maxsize"`
	MaxAge     int  `yaml:"maxage"`
	MaxBackups int  `yaml:"maxbackups"`
	LocalTime  bool `yaml:"localtime"`
	Compress   bool `yaml:"compress"`
}

type CommonLogConfigYAML_Backend

type CommonLogConfigYAML_Backend struct {
	Type          string                           `yaml:"type"`
	Level         string                           `yaml:"level"`
	ConsoleConfig *CommonLogConfigYAML_BKE_Console `yaml:"console_config"`
	FileConfig    *CommonLogConfigYAML_BKE_File    `yaml:"file_config"`
	AliSLSConfig  *CommonLogConfigYAML_BKE_AliSLS  `yaml:"alisls_config"`
}

type HiedaLogYamlUtil

type HiedaLogYamlUtil struct {
	Logger        *hiedalog.HiedaLogger
	AddedBackends map[string]hiedalog.HiedaLogBackend
	// contains filtered or unexported fields
}

func AddBackendsFromYAMLDataWithExistedLogger

func AddBackendsFromYAMLDataWithExistedLogger(logger *hiedalog.HiedaLogger, cfgdata CommonLogConfigYAML, autoStartAliSLS bool, clearExistBackends bool) (*HiedaLogYamlUtil, error)

func CreateHiedaLoggerFromYAMLData

func CreateHiedaLoggerFromYAMLData(cfgdata CommonLogConfigYAML, autoStartAliSLS bool) (*HiedaLogYamlUtil, error)

func (*HiedaLogYamlUtil) SafeShutdown

func (hyu *HiedaLogYamlUtil) SafeShutdown()

func (*HiedaLogYamlUtil) Shutdown

func (hyu *HiedaLogYamlUtil) Shutdown(timeout_ms int64) error

func (*HiedaLogYamlUtil) StartAliSLS

func (hyu *HiedaLogYamlUtil) StartAliSLS()

type SimpleConsoleBackend

type SimpleConsoleBackend struct {
	// contains filtered or unexported fields
}

func NewSimpleConsoleBackend

func NewSimpleConsoleBackend(wr io.Writer) *SimpleConsoleBackend

func (*SimpleConsoleBackend) EmitComplexLog

func (b *SimpleConsoleBackend) EmitComplexLog(module string, level hiedalog.HiedaLogLevel, data map[string]string)

func (*SimpleConsoleBackend) EmitStringLog

func (b *SimpleConsoleBackend) EmitStringLog(module string, level hiedalog.HiedaLogLevel, content string)

Jump to

Keyboard shortcuts

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