# README
logg
This is a very simple, but practical library for logging in applications. Currenty in process of superseding the logi library, once the pipe logger is converted, as it is integrated into the block sync progress logger.
To use it, create a file in a package you want
to add the logger to with the name log.go
, and then:
go run ./pkg/logg/deploy/.
from the root of the github.com/p9c/pod repository and it replicates its template with the altered package name to match the folder name - so you need to adhere to the rule that package names and the folder name are the same.
The library includes functions to toggle the filtering, highlight and filtering sets while it is running.
# Packages
No description provided by the author
# Functions
AddFilteredSubsystem adds a new subsystem Name to the highlighted list.
AddHighlightedSubsystem adds a new subsystem Name to the highlighted list.
AddLogChan adds a channel that log entries are sent to.
AddLoggerSubsystem adds a subsystem to the list of known subsystems and returns the string so it is nice and neat in the package logg.go file.
No description provided by the author
DirectionString is a helper function that returns a string that represents the direction of a connection (inbound or outbound).
No description provided by the author
GetLogPrinterSet returns a set of LevelPrinter with their subsystem preloaded.
LoadHighlightedSubsystems returns a copy of the map of highlighted subsystems.
LoadSubsystemFilter returns a copy of the map of filtered subsystems.
No description provided by the author
SetLogLevel sets the log level via a string, which can be truncated down to one character, similar to nmcli's argument processor, as the first letter is unique.
SetLogWriter atomically changes the log io.Writer interface.
SortSubsystemsList sorts the list of subsystems, to keep the data read-only, call this function right at the top of the main, which runs after declarations and main/init.
StoreHighlightedSubsystems sets the list of subsystems to highlight.
StoreSubsystemFilter sets the list of subsystems to filter.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
LevelSpecs specifies the id, string name and color-printing function.
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author