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 ¶
ReadBootstrapLogs reads tor logs from the given file and returns a list of bootstrap-related logs.
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.
Click to show internal directories.
Click to hide internal directories.