youlog

package
v0.0.0-...-5fea7ce Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LEVEL_DEBUG = 1
	LEVEL_INFO  = 2
	LEVEL_WARN  = 3
	LEVEL_ERROR = 4
	LEVEL_FATAL = 5
)

Variables

View Source
var DefaultScope = "Global"

Functions

This section is empty.

Types

type Fields

type Fields map[string]interface{}

type FluentdEngine

type FluentdEngine struct {
	Config *FluentdEngineConfig
	// contains filtered or unexported fields
}

func (*FluentdEngine) Init

func (e *FluentdEngine) Init() error

func (*FluentdEngine) WriteLog

func (e *FluentdEngine) WriteLog(context context.Context, scope *Scope, message string, level int64) error

type FluentdEngineConfig

type FluentdEngineConfig struct {
	Url string
}

type LogClient

type LogClient struct {
	Logger      *logrus.Logger
	Application string
	Instance    string
	Engines     []LogEngine
}

func (*LogClient) AddEngine

func (c *LogClient) AddEngine(engineConfig interface{}) error

func (*LogClient) Debug

func (c *LogClient) Debug(message ...interface{})

func (*LogClient) Error

func (c *LogClient) Error(message ...interface{})

func (*LogClient) Fatal

func (c *LogClient) Fatal(message ...interface{})

func (*LogClient) Info

func (c *LogClient) Info(message ...interface{})

func (*LogClient) Init

func (c *LogClient) Init(application string, instance string)

func (*LogClient) InitEngines

func (c *LogClient) InitEngines(context context.Context) error

func (*LogClient) NewScope

func (c *LogClient) NewScope(name string) *Scope

func (*LogClient) Warn

func (c *LogClient) Warn(message ...interface{})

func (*LogClient) WithFields

func (c *LogClient) WithFields(field Fields) *Scope

type LogData

type LogData struct {
	Application string `json:"application"`
	Instance    string `json:"instance"`
	Scope       string `json:"scope"`
	Extra       string `json:"extra"`
	Message     string `json:"message"`
	Level       int64  `json:"level"`
	Time        int64  `json:"time"`
}

type LogEngine

type LogEngine interface {
	Init() error
	WriteLog(context context.Context, scope *Scope, message string, level int64) error
}

type LogrusEngine

type LogrusEngine struct {
	Logger *logrus.Logger

	Config *LogrusEngineConfig
	// contains filtered or unexported fields
}

func (*LogrusEngine) Init

func (e *LogrusEngine) Init() error

func (*LogrusEngine) WriteLog

func (e *LogrusEngine) WriteLog(context context.Context, scope *Scope, message string, level int64) error

type LogrusEngineConfig

type LogrusEngineConfig struct {
}

type Scope

type Scope struct {
	LogClient *LogClient
	Name      string
	Fields    Fields
}

func (*Scope) Debug

func (c *Scope) Debug(message ...interface{})

func (*Scope) Error

func (c *Scope) Error(message ...interface{})

func (*Scope) Fatal

func (c *Scope) Fatal(message ...interface{})

func (*Scope) Info

func (c *Scope) Info(message ...interface{})

func (*Scope) SetFields

func (c *Scope) SetFields(fields Fields) *Scope

func (*Scope) Warn

func (c *Scope) Warn(message ...interface{})

func (*Scope) WithFields

func (c *Scope) WithFields(fields Fields) *Scope

type YouLogClient

type YouLogClient struct {
	Address string
	// contains filtered or unexported fields
}

func NewYouLogClient

func NewYouLogClient(address string) *YouLogClient

func (*YouLogClient) GetClient

func (c *YouLogClient) GetClient() (logservice.LogServiceClient, error)

func (*YouLogClient) Init

func (c *YouLogClient) Init() error

type YouLogEngine

type YouLogEngine struct {
	Config *YouLogServiceEngineConfig
	// contains filtered or unexported fields
}

func (*YouLogEngine) Init

func (e *YouLogEngine) Init() error

func (*YouLogEngine) WriteLog

func (e *YouLogEngine) WriteLog(context context.Context, scope *Scope, message string, level int64) error

type YouLogServiceEngineConfig

type YouLogServiceEngineConfig struct {
	Address string `mapstructure:"address"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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