torlogs

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package torlogs contains code to read tor logs.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyLogFilePath indicates that the log file path is empty.
	ErrEmptyLogFilePath = errors.New("torlogs: empty log file path")

	// ErrCannotReadLogFile indicates we cannot read the log file.
	ErrCannotReadLogFile = errors.New("torlogs: cannot read the log file")

	// ErrNoBootstrapLogs indicates we could not find any bootstrap log in the log file.
	ErrNoBootstrapLogs = errors.New("torlogs: no bootstrap logs")

	// ErrCannotFindSubmatches indicates we cannot find submatches.
	ErrCannotFindSubmatches = errors.New("torlogs: cannot find submatches")
)

Functions

func ReadBootstrapLogs

func ReadBootstrapLogs(logFilePath string) ([]string, error)

ReadBootstrapLogs reads tor logs from the given file and returns a list of bootstrap-related logs.

func ReadBootstrapLogsOrWarn

func ReadBootstrapLogsOrWarn(logger model.Logger, logFilePath string) []string

ReadBootstrapLogsOrWarn is like ReadBootstrapLogs except that it does not return an error on failure, rather it emits a warning.

Types

type BootstrapInfo

type BootstrapInfo struct {
	// Progress is the progress (between 0 and 100)
	Progress int64

	// Tag is the machine readable description of the bootstrap state.
	Tag string

	// Summary is the human readable summary.
	Summary string
}

BootstrapInfo contains info extracted from a bootstrap log line.

func ParseBootstrapLogLine

func ParseBootstrapLogLine(logLine string) (*BootstrapInfo, error)

ParseBootstrapLogLine takes in input a bootstrap log line and returns in output the components of such a log line.

Jump to

Keyboard shortcuts

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