Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: remove redundant stack in error log (#1443)
Yilong Lief15ffd854b2
diff --git a/common/log/logger.go b/common/log/logger.goindex 6be51c57e3..87061aac1a 100644--- a/common/log/logger.go+++ b/common/log/logger.go@@ -37,8 +37,6 @@ func EnabledLevel(level zapcore.Level) bool {// Debug wraps the zap Logger's Debug method.func Debug(msg string, fields ...zap.Field) {- // See notes of function Error.- fields = append(fields, zap.StackSkip("stack", 2))gl.Debug(msg, fields...)}diff --git a/plugin/db/mysql/mysql.go b/plugin/db/mysql/mysql.goindex a28a9257db..e89d145e9e 100644--- a/plugin/db/mysql/mysql.go+++ b/plugin/db/mysql/mysql.go@@ -913,7 +913,7 @@ func (driver *Driver) Dump(ctx context.Context, database string, out io.Writer,log.Debug("flush tables in database with read locks",zap.String("database", database))if err := flushTablesWithReadLock(ctx, conn, database); err != nil {- log.Error("flush tables failed", zap.Error(err), zap.Stack("stack"))+ log.Error("flush tables failed", zap.Error(err))return "", err}diff --git a/server/activity_manager.go b/server/activity_manager.goindex 225ca31512..6464d3dd3d 100644--- a/server/activity_manager.go+++ b/server/activity_manager.go@@ -75,7 +75,7 @@ func (m *ActivityManager) CreateActivity(ctx context.Context, create *api.Activireturn nil, fmt.Errorf("updater principal not found for ID %v", create.CreatorID)}- // Call external webhook endpoint in Go routine to avoid blocking web serveing thread.+ // Call external webhook endpoint in Go routine to avoid blocking web serving thread.go func() {webhookCtx, err := m.getWebhookContext(ctx, activity, meta, updater)if err != nil {diff --git a/server/backup_runner.go b/server/backup_runner.goindex fa40c9e1e8..8a2f4703cd 100644--- a/server/backup_runner.go+++ b/server/backup_runner.go@@ -47,7 +47,7 @@ func (s *BackupRunner) Run(ctx context.Context, wg *sync.WaitGroup) {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Auto backup runner PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Auto backup runner PANIC RECOVER", zap.Error(err))}}()diff --git a/server/metric_reporter.go b/server/metric_reporter.goindex c608c931fc..7fc366ba14 100644--- a/server/metric_reporter.go+++ b/server/metric_reporter.go@@ -66,7 +66,7 @@ func (m *MetricReporter) Run(ctx context.Context, wg *sync.WaitGroup) {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Metrics reporter PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Metrics reporter PANIC RECOVER", zap.Error(err))}}()diff --git a/server/recover.go b/server/recover.goindex 1b41029bf9..0948e219f7 100644--- a/server/recover.go+++ b/server/recover.go@@ -16,7 +16,7 @@ func recoverMiddleware(next echo.HandlerFunc) echo.HandlerFunc {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Middleware PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Middleware PANIC RECOVER", zap.Error(err))c.Error(err)}diff --git a/server/schema_syncer.go b/server/schema_syncer.goindex 4fb0fdf321..f856edee85 100644--- a/server/schema_syncer.go+++ b/server/schema_syncer.go@@ -46,7 +46,7 @@ func (s *SchemaSyncer) Run(ctx context.Context, wg *sync.WaitGroup) {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Schema syncer PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Schema syncer PANIC RECOVER", zap.Error(err))}}()diff --git a/server/task_check_scheduler.go b/server/task_check_scheduler.goindex a4698e4ab5..06c9d139a3 100644--- a/server/task_check_scheduler.go+++ b/server/task_check_scheduler.go@@ -47,7 +47,7 @@ func (s *TaskCheckScheduler) Run(ctx context.Context, wg *sync.WaitGroup) {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Task check scheduler PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Task check scheduler PANIC RECOVER", zap.Error(err))}}()diff --git a/server/task_executor.go b/server/task_executor.goindex 41f54f231f..b6e0928223 100644--- a/server/task_executor.go+++ b/server/task_executor.go@@ -36,7 +36,7 @@ func RunTaskExecutorOnce(ctx context.Context, exec TaskExecutor, server *Server,if !ok {panicErr = fmt.Errorf("%v", r)}- log.Error("TaskExecutor PANIC RECOVER", zap.Error(panicErr), zap.Stack("stack"))+ log.Error("TaskExecutor PANIC RECOVER", zap.Error(panicErr))terminated = trueresult = nilerr = fmt.Errorf("encounter internal error when executing task")diff --git a/server/task_executor_pitr_cutover.go b/server/task_executor_pitr_cutover.goindex 496981f2c1..ce1b47b582 100644--- a/server/task_executor_pitr_cutover.go+++ b/server/task_executor_pitr_cutover.go@@ -60,7 +60,7 @@ func (exec *PITRCutoverTaskExecutor) pitrCutover(ctx context.Context, task *api.mysqlDriver, ok := driver.(*pluginmysql.Driver)if !ok {- log.Error("failed to cast driver to mysql.Driver", zap.Stack("stack"))+ log.Error("failed to cast driver to mysql.Driver")return true, nil, fmt.Errorf("[internal] cast driver to mysql.Driver failed")}@@ -75,7 +75,6 @@ func (exec *PITRCutoverTaskExecutor) pitrCutover(ctx context.Context, task *api.log.Error("Failed to swap the original and PITR database",zap.Int("issueID", issue.ID),zap.String("database", task.Database.Name),- zap.Stack("stack"),zap.Error(err))return true, nil, fmt.Errorf("failed to swap the original and PITR database, error[%w]", err)}diff --git a/server/task_executor_pitr_restore.go b/server/task_executor_pitr_restore.goindex 73cce4706e..66fa2db6fa 100644--- a/server/task_executor_pitr_restore.go+++ b/server/task_executor_pitr_restore.go@@ -82,7 +82,7 @@ func (exec *PITRRestoreTaskExecutor) doPITRRestore(ctx context.Context, task *apmysqlDriver, ok := driver.(*pluginmysql.Driver)if !ok {- log.Error("failed to cast driver to mysql.Driver", zap.Stack("stack"))+ log.Error("failed to cast driver to mysql.Driver")return fmt.Errorf("[internal] cast driver to mysql.Driver failed")}@@ -106,7 +106,6 @@ func (exec *PITRRestoreTaskExecutor) doPITRRestore(ctx context.Context, task *aplog.Error("failed to perform a PITR restore in the PITR database",zap.Int("issueID", issue.ID),zap.String("database", database.Name),- zap.Stack("stack"),zap.Error(err))return fmt.Errorf("failed to perform a PITR restore in the PITR database, error[%w]", err)}diff --git a/server/task_scheduler.go b/server/task_scheduler.goindex b1d38dc684..bbaa83e0b9 100644--- a/server/task_scheduler.go+++ b/server/task_scheduler.go@@ -58,7 +58,7 @@ func (s *TaskScheduler) Run(ctx context.Context, wg *sync.WaitGroup) {if !ok {err = fmt.Errorf("%v", r)}- log.Error("Task scheduler PANIC RECOVER", zap.Error(err), zap.Stack("stack"))+ log.Error("Task scheduler PANIC RECOVER", zap.Error(err))}}()