logging

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package logging is a thread-safe way to log video device information to a file. On startup, this package creates a unique filename and uses that filename throughout the lifetime of the program to log information such as which video devices are V4L2 compatible and the current operating system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoMap

type InfoMap = map[string]string

InfoMap is a map of information to be written to the log.

type Logger

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

Logger is a thread-safe logger that manages a single log file in config.ViamDotDir.

var (
	// GLoggerCamComp is the global logger-to-file for camera components.
	GLoggerCamComp *Logger
)

func NewLogger

func NewLogger() (*Logger, error)

NewLogger creates a new logger. Call Logger.Start to start logging.

func (*Logger) Log

func (l *Logger) Log(title string, m InfoMap) error

Log emits the data stored in the given InfoMap with the given title to the log file. This method is thread-safe.

func (*Logger) Start

func (l *Logger) Start(ctx context.Context) error

Start creates and initializes the logging file and periodically emits logs to it. This method is thread-safe.

Jump to

Keyboard shortcuts

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