RHEL requires the source code for dependencies to be included in the srpm. The spec file already expects that, but we've only included the vendored modules (i.e., the `vendor` directory) in the `rhel-8.2.` branch. Move vendoring to master, so that we can build RHEL packages from it as well. This commit is the result of running `go mod vendor`, which includes the vendored sources and updates go.mod and go.sum files. Fedora requires the opposite: dependencies should not be vendored. The spec file already ignores the `vendor` directory by default.
33 lines
790 B
Go
33 lines
790 B
Go
// +build !windows,!nacl,!plan9
|
|
|
|
package pipeline
|
|
|
|
import (
|
|
"log"
|
|
"log/syslog"
|
|
)
|
|
|
|
// forceLog should rarely be used. It forceable logs an entry to the
|
|
// Windows Event Log (on Windows) or to the SysLog (on Linux)
|
|
func forceLog(level LogLevel, msg string) {
|
|
if defaultLogger == nil {
|
|
return // Return fast if we failed to create the logger.
|
|
}
|
|
// We are logging it, ensure trailing newline
|
|
if len(msg) == 0 || msg[len(msg)-1] != '\n' {
|
|
msg += "\n" // Ensure trailing newline
|
|
}
|
|
switch level {
|
|
case LogFatal:
|
|
defaultLogger.Fatal(msg)
|
|
case LogPanic:
|
|
defaultLogger.Panic(msg)
|
|
case LogError, LogWarning, LogInfo:
|
|
defaultLogger.Print(msg)
|
|
}
|
|
}
|
|
|
|
var defaultLogger = func() *log.Logger {
|
|
l, _ := syslog.NewLogger(syslog.LOG_USER|syslog.LOG_WARNING, log.LstdFlags)
|
|
return l
|
|
}()
|