logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logger contains an event logger for rendering in-game events to the console

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attack added in v0.2.0

type Attack interface {
	HasName() string
	HasDamage() float64
}

type Level added in v0.1.0

type Level int
const (
	LevelInfo Level = iota
	LevelChat
	LevelCombat
	LevelError
)

func (Level) String added in v0.1.0

func (l Level) String() string

type Logger

type Logger struct {
	Writer io.Writer
}

func NewLogger

func NewLogger(writer io.Writer) *Logger

func (*Logger) Attack

func (l *Logger) Attack(attacker string, target string, attack Attack) error

func (*Logger) Log added in v0.1.0

func (l *Logger) Log(level Level, msg string)

func (*Logger) Status

func (l *Logger) Status(character string, health float64, armor float64) error

Jump to

Keyboard shortcuts

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