From 682b827c7ea60480fc38d27f8416b4f596349ac0 Mon Sep 17 00:00:00 2001 From: Oleh Herych Date: Tue, 11 Jul 2017 04:16:07 +0300 Subject: [PATCH] More clear log (#638) I don't see `nil` in log. I suggest the next changes *Before* ``` INSERT INTO `dish` (`dish_id`,`restaurant_id`,`name`,`source`,`entry_id`,`created_by`,`menu_id`,`category`,`description`,`price`,`score`,`flog_count`,`approve`,`activated`,`created_at`,`updatated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [59639fb56d9d9437b707a434 58a313719fee7b336da70c45 Chocolate Mousse Torte fsqi 51339970 Dessert Seasonal berry sauce 0 0 0 1 false 2017-07-10 18:39:33 2017-07-10 18:39:33] ``` *After* ``` INSERT INTO `dish` (`dish_id`,`restaurant_id`,`name`,`source`,`entry_id`,`created_by`,`menu_id`,`category`,`description`,`price`,`score`,`flog_count`,`approve`,`activated`,`created_at`,`updatated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"59639ec16d9d943782ce2f6c", "58a313719fee7b336da70c45", "Chocolate Mousse Torte", "fsqi", "51339970", "", "", "Dessert", "Seasonal berry sauce", 0, 0, 0, 1, false, "2017-07-10 18:35:29", "2017-07-10 18:35:29"} ``` --- engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine.go b/engine.go index b1478a24..5c48710e 100644 --- a/engine.go +++ b/engine.go @@ -267,7 +267,7 @@ func (engine *Engine) Ping() error { func (engine *Engine) logSQL(sqlStr string, sqlArgs ...interface{}) { if engine.showSQL && !engine.showExecTime { if len(sqlArgs) > 0 { - engine.logger.Infof("[SQL] %v %v", sqlStr, sqlArgs) + engine.logger.Infof("[SQL] %v %#v", sqlStr, sqlArgs) } else { engine.logger.Infof("[SQL] %v", sqlStr) }