From 6836dd6049558ff56683c317daa124e2d3551196 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Mon, 19 Feb 2024 18:12:52 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20LogMode(?= =?UTF-8?q?gormlogger.Error)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postgres_gorm/postgres_gorm.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/postgres_gorm/postgres_gorm.go b/postgres_gorm/postgres_gorm.go index 74c13ed1..a232173e 100644 --- a/postgres_gorm/postgres_gorm.go +++ b/postgres_gorm/postgres_gorm.go @@ -98,7 +98,9 @@ func Connect_WithApplicationName_err(ApplicationName string) error { dsn := GetDSN(ApplicationName) // - conf := &gorm.Config{} + conf := &gorm.Config{ + Logger: gormlogger.Default.LogMode(gormlogger.Error), + } //conn := postgres.Open(dsn) dialect := postgres.New(postgres.Config{ @@ -109,7 +111,7 @@ func Connect_WithApplicationName_err(ApplicationName string) error { //Conn, err = gorm.Open(conn, conf) Conn.Config.NamingStrategy = schema.NamingStrategy{TablePrefix: Settings.DB_SCHEMA + "."} - Conn.Config.Logger = gormlogger.Default.LogMode(gormlogger.Error) + //Conn.Config.Logger = gormlogger.Default.LogMode(gormlogger.Error) if err == nil { DB, err := Conn.DB()