mirror of https://github.com/jackc/pgx.git
Make CopyFrom log message more specific
parent
41fa6e844c
commit
38ab93613b
|
@ -157,10 +157,10 @@ func (ct *copyFrom) run(ctx context.Context) (int64, error) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if ct.conn.shouldLog(LogLevelInfo) {
|
if ct.conn.shouldLog(LogLevelInfo) {
|
||||||
endTime := time.Now()
|
endTime := time.Now()
|
||||||
ct.conn.log(ctx, LogLevelInfo, "Copy", map[string]interface{}{"tableName": ct.tableName, "columnNames": ct.columnNames, "time": endTime.Sub(startTime), "rowCount": rowsAffected})
|
ct.conn.log(ctx, LogLevelInfo, "CopyFrom", map[string]interface{}{"tableName": ct.tableName, "columnNames": ct.columnNames, "time": endTime.Sub(startTime), "rowCount": rowsAffected})
|
||||||
}
|
}
|
||||||
} else if ct.conn.shouldLog(LogLevelError) {
|
} else if ct.conn.shouldLog(LogLevelError) {
|
||||||
ct.conn.log(ctx, LogLevelError, "Copy", map[string]interface{}{"err": err, "tableName": ct.tableName, "columnNames": ct.columnNames})
|
ct.conn.log(ctx, LogLevelError, "CopyFrom", map[string]interface{}{"err": err, "tableName": ct.tableName, "columnNames": ct.columnNames})
|
||||||
}
|
}
|
||||||
|
|
||||||
return rowsAffected, err
|
return rowsAffected, err
|
||||||
|
|
Loading…
Reference in New Issue