Documentation ¶
Index ¶
- Variables
- type Ctrl
- func (c *Ctrl) Dump() ([]byte, error)
- func (v Ctrl) MarshalEasyJSON(w *jwriter.Writer)
- func (v Ctrl) MarshalJSON() ([]byte, error)
- func (c *Ctrl) NewEvent(msg string, typ Source, srcChar int) Event
- func (c *Ctrl) NewEventBuildMsg(typ Source, srcChar int, msg ...string) Event
- func (v *Ctrl) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Ctrl) UnmarshalJSON(data []byte) error
- type Event
- type EventArr
- type LogEvent
- func (e *LogEvent) LogSource() Source
- func (v LogEvent) MarshalEasyJSON(w *jwriter.Writer)
- func (v LogEvent) MarshalJSON() ([]byte, error)
- func (e *LogEvent) SetEnded(end int) Event
- func (e *LogEvent) Src() int
- func (e *LogEvent) StartFrame() int
- func (v *LogEvent) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *LogEvent) UnmarshalJSON(data []byte) error
- func (e *LogEvent) Write(key string, value interface{}) Event
- func (e *LogEvent) WriteBuildMsg(keysAndValues ...interface{}) Event
- type Logger
- type NilLogEvent
- type NilLogger
- type Source
Constants ¶
This section is empty.
Variables ¶
var LogSourceFromString = map[string]Source{ "": LogInvalid, "damage": LogDamageEvent, "pre_damage_mods": LogPreDamageMod, "calc": LogCalc, "element": LogElementEvent, "snapshot": LogSnapshotEvent, "status": LogStatusEvent, "action": LogActionEvent, "energy": LogEnergyEvent, "character": LogCharacterEvent, "enemy": LogEnemyEvent, "sim": LogSimEvent, "artifact": LogArtifactEvent, "weapon": LogWeaponEvent, "shield": LogShieldEvent, "construct": LogConstructEvent, "icd": LogICDEvent, "debug": LogDebugEvent, "warning": LogWarnings, "player": LogPlayerEvent, "heal": LogHealEvent, "hurt": LogHurtEvent, "cooldown": LogCooldownEvent, "hitlag": LogHitlagEvent, "user": LogUserEvent, }
var LogSourceString = [...]string{
"",
"damage",
"pre_damage_mods",
"calc",
"element",
"snapshot",
"status",
"action",
"energy",
"character",
"enemy",
"sim",
"artifact",
"weapon",
"shield",
"construct",
"icd",
"debug",
"warning",
"player",
"heal",
"hurt",
"cooldown",
"hitlag",
"user",
}
Functions ¶
This section is empty.
Types ¶
type Ctrl ¶
type Ctrl struct {
// contains filtered or unexported fields
}
func (Ctrl) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Ctrl) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Ctrl) NewEventBuildMsg ¶
func (*Ctrl) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Ctrl) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Event ¶
type Event interface { LogSource() Source //returns the type of this log event i.e. character, sim, damage, etc... StartFrame() int //returns the frame on which this event was started Src() int //returns the index of the character that triggered this event. -1 if it's not a character WriteBuildMsg(keyAndVal ...interface{}) Event //write additional keyAndVal pairs to the event Write(key string, val interface{}) Event //write additional keyAndVal pairs to the event SetEnded(f int) Event }
Event describes one event to be logged
type EventArr ¶
type EventArr []*LogEvent
func (EventArr) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventArr) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*EventArr) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventArr) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type LogEvent ¶
type LogEvent struct { Typ Source `json:"event"` F int `json:"frame"` Ended int `json:"ended"` SrcChar int `json:"char_index"` Msg string `json:"msg,nocopy"` Logs map[string]interface{} `json:"logs"` Ordering map[string]int `json:"ordering"` // contains filtered or unexported fields }
func (LogEvent) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (LogEvent) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*LogEvent) StartFrame ¶
func (*LogEvent) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LogEvent) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*LogEvent) WriteBuildMsg ¶
type Logger ¶
type Logger interface { // NewEvent(msg string, typ Source, srcChar int, keysAndValues ...interface{}) Event NewEvent(msg string, typ Source, srcChar int) Event NewEventBuildMsg(typ Source, srcChar int, msg ...string) Event Dump() ([]byte, error) //print out all the logged events in array of JSON strings in the ordered they were added }
Logger records LogEvents
type NilLogEvent ¶
type NilLogEvent struct{}
NilLogEvent implements LogEvent and is used when no logger is needed
func (*NilLogEvent) LogSource ¶
func (n *NilLogEvent) LogSource() Source
func (*NilLogEvent) SetEnded ¶
func (n *NilLogEvent) SetEnded(f int) Event
func (*NilLogEvent) Src ¶
func (n *NilLogEvent) Src() int
func (*NilLogEvent) StartFrame ¶
func (n *NilLogEvent) StartFrame() int
func (*NilLogEvent) Write ¶
func (n *NilLogEvent) Write(key string, val interface{}) Event
func (*NilLogEvent) WriteBuildMsg ¶
func (n *NilLogEvent) WriteBuildMsg(keyAndVal ...interface{}) Event
type NilLogger ¶
type NilLogger struct{}
NilLogger implements Logger and is used when no logger is needed
type Source ¶
type Source int
const ( LogInvalid Source = iota LogDamageEvent //tracks damages LogPreDamageMod LogCalc //detailed calcs LogElementEvent //tracks elemental application LogSnapshotEvent LogStatusEvent LogActionEvent LogEnergyEvent LogCharacterEvent LogEnemyEvent LogSimEvent LogArtifactEvent LogWeaponEvent LogShieldEvent LogConstructEvent LogICDEvent LogDebugEvent // for debug purposes LogWarnings // for things that go wrong LogPlayerEvent // for events related to player i.e. stamina, swap cd, healing, taking dmg etc.. LogHealEvent // healing events LogHurtEvent // taking dmg event LogCooldownEvent // for tracking things going on and off cooldown LogHitlagEvent // for debugging hitlag LogUserEvent //user print event )