Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalError ¶
FatalError tries to write a log error and exist with the status code notest
func Log ¶
Log saves a log message with the specified level and parameters to the configured log targets.
func LogInit ¶
func LogInit(config LogConfig)
LogInit initializes the logging system based on the provided configuration. It sets up loggers for writing to stdout/stderr or file, and sets the minimum logging level. If the configuration specifies "testing_buffer" as the file, it redirects logging output to a testing buffer. The loggers are stored in the loggers map for later use.
Types ¶
type Command ¶
type Command struct { Command string // The command to be executed. Environment map[string]string // Environment variables for the command. Directory string // Working directory for the command. Timeout int // Timeout duration in seconds. Shell string // Shell used to execute the command. Stdout string // Standard output of the command. Stderr string // Standard error of the command. Rc int // Return code of the command. Error error // Error encountered during command execution. }
Command represents a system command to be executed.
func NewCommand ¶
NewCommand creates a new Command with default settings.
type LogBuilder ¶
type LogBuilder struct {
// contains filtered or unexported fields
}
func NewLogBuilder ¶
func NewLogBuilder(message string) *LogBuilder
NewLogBuilder creates a new LogBuilder instance with the specified log message.
func (*LogBuilder) Level ¶
func (b *LogBuilder) Level(level string) *LogBuilder
Level sets the logging level for the LogBuilder.
func (*LogBuilder) Save ¶
func (b *LogBuilder) Save()
Save builds the log parameters and invokes the Log function to save the log message.
func (*LogBuilder) Set ¶
func (b *LogBuilder) Set(params ...interface{}) *LogBuilder
Set adds parameters to the LogBuilder.