chore: add log for initplugins and db migration
diff --git a/backend/core/plugin/hub.go b/backend/core/plugin/hub.go
index 6788c90..b0a50b7 100644
--- a/backend/core/plugin/hub.go
+++ b/backend/core/plugin/hub.go
@@ -73,6 +73,13 @@
}
func InitPlugins(basicRes context.BasicRes) {
+ if basicRes == nil {
+ panic("basicRes is nil")
+ } else if basicRes.GetDal() == nil {
+ panic("basicRes.GetDal() return nil")
+ }
+ logger := basicRes.GetLogger()
+ logger.Info("start initialize plugins")
for pluginName, pluginMeta := range plugins {
if pluginEntry, ok := pluginMeta.(PluginInit); ok {
err := pluginEntry.Init(basicRes)
@@ -80,7 +87,8 @@
panic(fmt.Errorf("failed to initialize plugin %v due to %w", pluginName, err))
}
} else {
- basicRes.GetLogger().Info("plugin: %s doesn't implement 'PluginInit', it will be skipped.", pluginName)
+ logger.Info("plugin: %s doesn't implement 'PluginInit', it will be skipped.", pluginName)
}
}
+ logger.Info("plugins initialized succesfully")
}
diff --git a/backend/server/services/init.go b/backend/server/services/init.go
index b40d99f..6d587b6 100644
--- a/backend/server/services/init.go
+++ b/backend/server/services/init.go
@@ -105,16 +105,21 @@
panic(err)
}
}
- logger.Info("Db migration confirmation needed")
+
+ if !forceMigration {
+ logger.Info("db migration confirmation needed")
+ }
}
// ExecuteMigration executes all pending migration scripts and initialize services module
func ExecuteMigration() errors.Error {
// apply all pending migration scripts
+ logger.Info("start db migration")
err := migrator.Execute()
if err != nil {
return err
}
+ logger.Info("db migration finished successfully")
// cronjob for blueprint triggering
location := cron.WithLocation(time.UTC)