Commit 86825056 authored by Vladimir Barsukov's avatar Vladimir Barsukov
Browse files

log

parent c2aea025
......@@ -421,8 +421,21 @@ func (d *Pool) prepare(sql string, param map[string]any) string {
}
}
if _, ok := param["_debug"]; ok {
d.logger.Printf(sql)
if v, ok := param["_debug"]; ok {
switch vv := v.(type) {
case bool:
if vv {
d.logger.Printf(sql)
}
case int, uint:
if vv == 1 {
d.logger.Printf(sql)
}
case string:
if vv == "1" {
d.logger.Printf(sql)
}
}
}
return sql
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment