logwriter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 0

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

func New(dir string) (*Writer, error)

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) Close

func (w *Writer) Close() error

Close closes the log file.

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.

Jump to

Keyboard shortcuts

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