kairos-sdk/types/logger_linux.go
Itxaka 571996d6ba
Be able to build the logger on windows (#596)
Seems like provider can build for windows for the kairosctl command and
it would fail due to the systemd libs not being available to build under
windows so we need to protect against that

Signed-off-by: Itxaka <itxaka@kairos.io>
2025-05-06 11:19:17 +02:00

24 lines
343 B
Go

//go:build !windows
package types
import (
"io"
"net"
"github.com/rs/zerolog/journald"
)
func isJournaldAvailable() bool {
conn, err := net.Dial("unixgram", "/run/systemd/journal/socket")
if err != nil {
return false
}
defer conn.Close()
return true
}
func getJournaldWriter() io.Writer {
return journald.NewJournalDWriter()
}