Documentation ¶
Index ¶
- Constants
- func WithLogAppName(appname string) appNameOption
- func WithLogDir(dir string) dirOption
- func WithLogFormatter(formatter string) formatterOption
- func WithLogLevel(level string) levelOption
- func WithLogShowLine(s bool) showLineOption
- type GameFormatter
- type GameLogType
- type ILoggerOption
- type Logger
- type LogrusConf
- type Option
Constants ¶
View Source
const ( FORMAT_TEXT = "text" FORMAT_JSON = "json" FORMAT_CUSTOM = "custom" )
View Source
const FileSuffix = ".log"
Variables ¶
This section is empty.
Functions ¶
func WithLogAppName ¶
func WithLogAppName(appname string) appNameOption
func WithLogDir ¶
func WithLogDir(dir string) dirOption
func WithLogFormatter ¶
func WithLogFormatter(formatter string) formatterOption
func WithLogLevel ¶
func WithLogLevel(level string) levelOption
func WithLogShowLine ¶
func WithLogShowLine(s bool) showLineOption
Types ¶
type GameFormatter ¶
type GameFormatter struct { AppName string ForceColors bool // contains filtered or unexported fields }
func NewGameFormater ¶
func NewGameFormater(appName string, types GameLogType) *GameFormatter
func (*GameFormatter) AddType ¶
func (m *GameFormatter) AddType(t GameLogType)
func (*GameFormatter) RemoveType ¶
func (m *GameFormatter) RemoveType(t GameLogType)
type GameLogType ¶
type GameLogType uint32
const ( TYPE_REDIS GameLogType = 1 << iota TYPE_TCP TYPE_ROUTER TYPE_CGI TYPE_GAME )
const TYPE_UNKNOW GameLogType = 0
func ParseGameLogType ¶
func ParseGameLogType(s string) GameLogType
type ILoggerOption ¶
type ILoggerOption interface {
Apply(*Option)
}
type Logger ¶
func New ¶
func New(opts ...ILoggerOption) *Logger
func (*Logger) HackDefaultLogger ¶
func (log *Logger) HackDefaultLogger()
func (*Logger) SetLogLevel ¶
type LogrusConf ¶
type LogrusConf = Option
Click to show internal directories.
Click to hide internal directories.