Documentation
¶
Overview ¶
Package logwriter provides crash-safe file logging for console/game log entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes console log entries to a text file, one line per entry. Syncs after every write for crash safety.
func New ¶
New creates a Writer that logs to the given directory. A new log file is created with a timestamp-based name. Returns nil if dir is empty (disabled).
func (*Writer) Write ¶
func (w *Writer) Write(entry protocol.ConsoleLogEntry) error
Write appends a single console log entry to the file.
func (*Writer) WriteBatch ¶
func (w *Writer) WriteBatch(entries []protocol.ConsoleLogEntry) error
WriteBatch writes multiple entries at once.
Click to show internal directories.
Click to hide internal directories.