feat(GODT-3195): add OS info to the log.
This commit is contained in:
parent
5751166ebc
commit
2895f42a64
|
@ -44,6 +44,7 @@ import (
|
||||||
"github.com/ProtonMail/proton-bridge/v3/internal/vault"
|
"github.com/ProtonMail/proton-bridge/v3/internal/vault"
|
||||||
"github.com/ProtonMail/proton-bridge/v3/pkg/keychain"
|
"github.com/ProtonMail/proton-bridge/v3/pkg/keychain"
|
||||||
"github.com/ProtonMail/proton-bridge/v3/pkg/restarter"
|
"github.com/ProtonMail/proton-bridge/v3/pkg/restarter"
|
||||||
|
"github.com/elastic/go-sysinfo"
|
||||||
"github.com/pkg/profile"
|
"github.com/pkg/profile"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
@ -378,6 +379,18 @@ func withLogging(c *cli.Context, crashHandler *crash.Handler, locations *locatio
|
||||||
WithField("offset", now.Format("-07:00:00")).
|
WithField("offset", now.Format("-07:00:00")).
|
||||||
Info("Time zone info")
|
Info("Time zone info")
|
||||||
|
|
||||||
|
host, err := sysinfo.Host()
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithError(err).Error("Could not retrieve operating system info")
|
||||||
|
} else {
|
||||||
|
osInfo := host.Info().OS
|
||||||
|
logrus.
|
||||||
|
WithField("name", osInfo.Name).
|
||||||
|
WithField("version", osInfo.Version).
|
||||||
|
WithField("build", osInfo.Build).
|
||||||
|
Info("Operating system info")
|
||||||
|
}
|
||||||
|
|
||||||
return fn(closer)
|
return fn(closer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue