[service] Move logging to the core, remove pkg level logs

This commit is contained in:
Daniel
2024-11-14 17:33:27 +01:00
parent 8b1bdc7eb1
commit f91003d077
22 changed files with 360 additions and 306 deletions

View File

@@ -153,6 +153,28 @@ func FullVersion() string {
return builder.String()
}
// CondensedVersion returns the rather complete, but condensed version string.
func CondensedVersion() string {
info := GetInfo()
cgoInfo := "-cgo"
if info.CGO {
cgoInfo = "+cgo"
}
dirtyInfo := "clean"
if info.Dirty {
dirtyInfo = "dirty"
}
return fmt.Sprintf(
"%s %s (%s; built with %s [%s %s] from %s [%s] at %s)",
info.Name, version,
runtime.GOOS,
runtime.Version(), runtime.Compiler, cgoInfo,
info.Commit, dirtyInfo, info.CommitTime,
)
}
// CheckVersion checks if the metadata is ok.
func CheckVersion() error {
switch {