logs

package
v7.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

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 BuilderIndexLabel added in v7.1.7

func BuilderIndexLabel(idx primitives.BuilderIndex) string

func ConfigureEphemeralLogFile added in v7.1.3

func ConfigureEphemeralLogFile(datadirPath string, app string) error

ConfigureEphemeralLogFile adds a log file that keeps 24 hours of logs with >debug verbosity.

func ConfigurePersistentLogging

func ConfigurePersistentLogging(logFileName string, format string, lvl logrus.Level, vmodule map[string]logrus.Level) 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.

func PackageVerbosity added in v7.1.3

func PackageVerbosity(packagePath string) logrus.Level

PackageVerbosity returns the verbosity of a given package.

func SetLoggingLevelAndData added in v7.1.3

func SetLoggingLevelAndData(baseVerbosity logrus.Level, vmoduleMap map[string]logrus.Level, maxVmoduleLevel logrus.Level, disableEphemeral bool)

SetLoggingLevelAndData sets the base logging level for logrus.

Types

type HookIdentifier added in v7.1.3

type HookIdentifier string
const (
	LogTargetField                    = "log_target"
	LogTargetEphemeral HookIdentifier = "ephemeral"
	LogTargetUser      HookIdentifier = "user"
)

type StreamServer

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

StreamServer defines 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 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.

type WriterHook added in v7.1.3

type WriterHook struct {
	AllowedLevels []logrus.Level
	Writer        io.Writer
	Formatter     logrus.Formatter
	Identifier    HookIdentifier
}

func (*WriterHook) Fire added in v7.1.3

func (hook *WriterHook) Fire(entry *logrus.Entry) error

func (*WriterHook) Levels added in v7.1.3

func (hook *WriterHook) Levels() []logrus.Level

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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