zaplog

package
v8.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dev  string = "development"
	Prod string = "production"
)

Variables

This section is empty.

Functions

func InitGlobalLogger

func InitGlobalLogger(c LogConfig)

func Release

func Release()

func TSDB

func TSDB() tstorage.Storage

Types

type Labels

type Labels map[string]string

type LogConfig

type LogConfig struct {
	Mode           string
	ConsoleEnable  bool
	LokiEnable     bool
	FileEnable     bool
	Filename       string
	LokiApi        string
	LokiUser       string
	LokiPwd        string
	LokiJob        string
	QueueSize      int
	MetricsStorage string
	MetricsHistory int
}

type Logger

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

func (*Logger) Init

func (l *Logger) Init(c LogConfig)

func (*Logger) Release

func (l *Logger) Release()

type LokiClient

type LokiClient struct {
	Job      string
	ApiUrl   string
	ApiUser  string
	ApiPwd   string
	Debug    bool
	BuffSize int
	// contains filtered or unexported fields
}

func NewLokiClient

func NewLokiClient(job, apiUrl, user, pwd string, buff int) *LokiClient

func (*LokiClient) Error

func (c *LokiClient) Error(msg string)

func (*LokiClient) Info

func (c *LokiClient) Info(msg string)

func (*LokiClient) Start

func (c *LokiClient) Start()

func (*LokiClient) Stop

func (c *LokiClient) Stop()

func (*LokiClient) Warn

func (c *LokiClient) Warn(msg string)

type StreamObject

type StreamObject struct {
	Stream map[string]string `json:"stream"`
	Values [][]string        `json:"values"`
}

func NewStreamObject

func NewStreamObject(labels Labels) *StreamObject

func (*StreamObject) AddLogItem

func (s *StreamObject) AddLogItem(log ...string)

type Streams

type Streams struct {
	Streams []*StreamObject `json:"streams"`
}

func NewStreams

func NewStreams(streams ...*StreamObject) *Streams

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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