logutil

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: GPL-3.0 Imports: 10 Imported by: 24

Documentation

Overview

Package logutil creates a Multi writer instance that write all logs that are written to stdout.

Index

Constants

View Source
const (
	// LogCacheSize is the number of log entries to keep in memory for new
	// websocket connections.
	LogCacheSize = 20
)

Variables

This section is empty.

Functions

func ConfigurePersistentLogging

func ConfigurePersistentLogging(logFileName string) error

ConfigurePersistentLogging adds a log-to-file writer. File content is identical to stdout.

Types

type StreamServer added in v1.0.0

type StreamServer struct {
	// contains filtered or unexported fields
}

StreamServer defines a a websocket server which can receive events from a feed and write them to open websocket connections.

func NewLogStreamServer added in v1.0.0

func NewLogStreamServer() *StreamServer

NewLogStreamServer initializes a new stream server capable of streaming log events via a websocket connection.

func (*StreamServer) Handler added in v1.0.0

func (ss *StreamServer) Handler(w http.ResponseWriter, r *http.Request)

Handler for new websocket connections to stream new events received via an event feed as they occur.

func (*StreamServer) Write added in v1.0.0

func (ss *StreamServer) Write(p []byte) (n int, err error)

Write a binary message and send over the event feed.

Jump to

Keyboard shortcuts

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