1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(logging): replace all the loggers with zerolog EE-4186 (#7663)

This commit is contained in:
andres-portainer 2022-09-16 13:18:44 -03:00 committed by GitHub
parent 53025178ef
commit 36e7981ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 1101 additions and 662 deletions

View file

@ -5,8 +5,10 @@ import (
"reflect"
"runtime"
werrors "github.com/pkg/errors"
portainer "github.com/portainer/portainer/api"
werrors "github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
type migration struct {
@ -114,7 +116,7 @@ func (m *Migrator) Migrate() error {
// Print the next line only when the version changes
if migration.dbversion > lastDbVersion {
migrateLog.Infof("Migrating DB to version %d", migration.dbversion)
log.Info().Int("to_version", migration.dbversion).Msg("migrating DB")
}
err := migration.migrate()
@ -125,12 +127,14 @@ func (m *Migrator) Migrate() error {
lastDbVersion = migration.dbversion
}
migrateLog.Infof("Setting DB version to %d", portainer.DBVersion)
log.Info().Int("version", portainer.DBVersion).Msg("setting DB version")
err = m.versionService.StoreDBVersion(portainer.DBVersion)
if err != nil {
return migrationError(err, "StoreDBVersion")
}
migrateLog.Infof("Updated DB version to %d", portainer.DBVersion)
log.Info().Int("version", portainer.DBVersion).Msg("updated DB version")
// reset DB updating status
return m.versionService.StoreIsUpdating(false)