logs

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: GPL-3.0 Imports: 10 Imported by: 8

Documentation

Overview

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

Index

Constants

This section is empty.

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.

func MaskCredentialsLogging

func MaskCredentialsLogging(currUrl string) string

MaskCredentialsLogging masks the url credentials before logging for security purpose [scheme:][//[userinfo@]host][/]path[?query][#fragment] --> [scheme:][//[***]host][/***][#***] if the format is not matched nothing is done, string is returned as is.

Types

type StreamServer

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 NewStreamServer

func NewStreamServer() *StreamServer

NewStreamServer initializes a new stream server capable of streaming log events.

func (*StreamServer) GetLastFewLogs

func (ss *StreamServer) GetLastFewLogs() [][]byte

GetLastFewLogs returns the last few entries of logs stored in an LRU cache.

func (*StreamServer) LogsFeed

func (ss *StreamServer) LogsFeed() *event.Feed

LogsFeed returns a feed callers can subscribe to to receive logs via a channel.

func (*StreamServer) Write

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

Write a binary message and send over the event feed.

type Streamer

type Streamer interface {
	GetLastFewLogs() [][]byte
	LogsFeed() *event.Feed
}

Streamer defines a struct which can retrieve and stream process logs.

Jump to

Keyboard shortcuts

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