msglog

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const LogColorDefine = `` /* 749-byte string literal not displayed */

使用github.com/bobwong89757/golog的cellnet配色方案

Variables

This section is empty.

Functions

func BlockMessageLog deprecated

func BlockMessageLog(nameRule string) (err error, matchCount int)

Deprecated: 按指定规则(或消息名)屏蔽消息日志, 需要使用完整消息名 例如 proto.MsgName

func IsBlockedMessageByID deprecated

func IsBlockedMessageByID(msgid int) bool

Deprecated: 当前的某个消息ID是否被屏蔽

func IsMsgLogValid added in v0.0.3

func IsMsgLogValid(msgid int) bool

能否显示消息日志

func RemoveBlockedMessage deprecated added in v0.0.3

func RemoveBlockedMessage(nameRule string) (err error, matchCount int)

Deprecated: 移除被屏蔽的消息

func SetCurrMsgLogMode added in v0.0.3

func SetCurrMsgLogMode(mode MsgLogMode)

设置当前的消息日志处理模式

func SetMsgLogRule added in v0.0.3

func SetMsgLogRule(name string, rule MsgLogRule) error

指定某个消息的处理规则, 消息格式: packageName.MsgName

func VisitBlockedMessage deprecated added in v0.0.3

func VisitBlockedMessage(callback func(*cellnet.MessageMeta) bool)

Deprecated: 遍历被屏蔽的消息

func VisitMsgLogRule added in v0.0.3

func VisitMsgLogRule(mode MsgLogMode, callback func(*cellnet.MessageMeta) bool)

遍历消息规则

func WriteRecvLogger

func WriteRecvLogger(log *golog.Logger, protocol string, ses cellnet.Session, msg interface{})

func WriteSendLogger

func WriteSendLogger(log *golog.Logger, protocol string, ses cellnet.Session, msg interface{})

Types

type MsgLogMode added in v0.0.3

type MsgLogMode int
const (
	// 显示所有的消息日志
	MsgLogMode_ShowAll MsgLogMode = iota

	// 禁用所有的消息日志
	MsgLogMode_Mute

	// 黑名单内的不显示
	MsgLogMode_BlackList

	// 只显示白名单的日志
	MsgLogMode_WhiteList
)

func GetCurrMsgLogMode added in v0.0.3

func GetCurrMsgLogMode() MsgLogMode

获取当前的消息日志处理模式

type MsgLogRule added in v0.0.3

type MsgLogRule int
const (
	// 显示所有的消息日志
	MsgLogRule_None MsgLogRule = iota

	// 黑名单内的不显示
	MsgLogRule_BlackList

	// 只显示白名单的日志
	MsgLogRule_WhiteList
)

type PacketMessagePeeker

type PacketMessagePeeker interface {
	Message() interface{}
}

萃取消息中的消息

Jump to

Keyboard shortcuts

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