plogger

package
v0.0.0-...-4cb4d4a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTypePendingBlock = 1000
	LogTypeMaturedBlock = 2000
	LogTypePaymentWork  = 3000

	LogTypeSystem = 7000
)
View Source
const (
	LogErrorNothing                = 0
	LogSubTypeImmaturedBlock       = 201
	LogSubTypeOrphanBlcok          = 202
	LogSubTypeLostBlcok            = 203
	LogSubTypePaymentLock          = 301
	LogSubTypePaymentTransaction   = 302
	LogSubTypePaymentUnlock        = 303
	LogSubTypePaymentWriteDB       = 304
	LogSubTypePaymentTxWait        = 305
	LogSubTypePaymentTxComplete    = 306
	LogSubTypeError                = 10000
	LogSubTypeSystemRoundInfoRedis = 10001
	LogErrorNothingRoundBlock      = 10002
)

Variables

This section is empty.

Functions

func InsertLog

func InsertLog(content string, msgType int, msgErr int, roundHeight int64, height int64, addr, addr2 string)

func InsertSystemError

func InsertSystemError(logType int, roundHeight int64, height int64, format string, v ...interface{})

func InsertSystemPaymemtError

func InsertSystemPaymemtError(logType int, addr string, addr2 string, format string, v ...interface{})

func Save

func Save()

Types

type LogDB

type LogDB interface {
	InsertSqlLog(sql *string)
}

type Logger

type Logger struct {
	MsgQueue chan Msg
	Db       LogDB

	InsertCnt int // insert count
	// contains filtered or unexported fields
}

func New

func New(db LogDB, where string, logTableName string) *Logger

func (*Logger) Close

func (l *Logger) Close()

func (*Logger) Save

func (l *Logger) Save(id int, insertSize int)

type Msg

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

Jump to

Keyboard shortcuts

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