loghelper

package
v0.0.0-...-bef4ad1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMENT   = 1
	LIKE_BLOG = 2
	SCORE     = 3
)

Variables

This section is empty.

Functions

func BuildWriter

func BuildWriter(target string) io.Writer

BuildWriter Create an io.Writer write logs to log service

func ProtoToLog

func ProtoToLog(log *logservice.LogModel) *logmodel.LogModel

ProtoToLog log proto to log model

Types

type Log

type Log struct {
	Operator             primitive.ObjectID
	Operation            int32
	OperationTarget      primitive.ObjectID
	LogLevel             logservice.LogModel_Level
	ExtraMessage         string
	OperationTargetOwner primitive.ObjectID
}

Log log struct

type LogClient

type LogClient struct {
	Client logservice.LogClient
}

LogClient as name

func GetNotifyLogClient

func GetNotifyLogClient() *LogClient

func (*LogClient) Init

func (l *LogClient) Init(targetEnv string)

Init log client

func (*LogClient) LogInfo

func (l *LogClient) LogInfo(log Log) error

LogInfo log at info level

func (*LogClient) LogMsg

func (l *LogClient) LogMsg(ctx context.Context, log Log) error

LogMsg log a message

Jump to

Keyboard shortcuts

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