system

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeServiceLogger added in v1.57.0

func InitializeServiceLogger(stackFilePath string)

InitializeLogger sets the file path for the singleton instance This must be called before the singleton is accessed.

func Log

func Log(msg string)

func Logf added in v1.54.8

func Logf(format string, args ...interface{})

func PurgeLogs added in v1.57.0

func PurgeLogs() error

PurgeLogs truncates the log file to remove all log entries

func SubscribeToLogs

func SubscribeToLogs(subscription func(string))

Types

type LogEntry added in v1.57.0

type LogEntry struct {
	Timestamp time.Time    `json:"time"`
	Level     logrus.Level `json:"level"`
	Message   string       `json:"msg"`
	Origin    string       `json:"origin"`
}

func ReadLogs added in v1.57.0

func ReadLogs() ([]LogEntry, error)

ReadLogs reads the log file from the service's log file path and returns a slice of LogEntry objects

type ServiceLogger added in v1.57.0

type ServiceLogger struct {
	Logger      *logrus.Logger
	LogFilePath string
}

ServiceLogger struct to encapsulate the logger and file path

func GetServiceLogger added in v1.57.0

func GetServiceLogger() *ServiceLogger

GetServiceLogger retrieves the singleton instance of the ServiceLogger

func (*ServiceLogger) WriteLog added in v1.57.0

func (s *ServiceLogger) WriteLog(level logrus.Level, message, origin string)

WriteLog writes a log entry with the specified level and message

type SystemLogsService

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

SystemLogsService - An EventBus service for handling logging of events and exceptions So they can be subscribed to and displayed in the CLI

Jump to

Keyboard shortcuts

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