mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
Show number of results from a query in the logs
This commit is contained in:
parent
67865512c8
commit
643c763cb4
1 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -222,7 +223,7 @@ func (r sqlRepository) queryAll(sq SelectBuilder, response interface{}, options
|
||||||
r.logSQL(query, args, nil, -1, start)
|
r.logSQL(query, args, nil, -1, start)
|
||||||
return model.ErrNotFound
|
return model.ErrNotFound
|
||||||
}
|
}
|
||||||
r.logSQL(query, args, err, -1, start)
|
r.logSQL(query, args, err, int64(reflect.ValueOf(response).Elem().Len()), start)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +239,7 @@ func (r sqlRepository) queryAllSlice(sq SelectBuilder, response interface{}) err
|
||||||
r.logSQL(query, args, nil, -1, start)
|
r.logSQL(query, args, nil, -1, start)
|
||||||
return model.ErrNotFound
|
return model.ErrNotFound
|
||||||
}
|
}
|
||||||
r.logSQL(query, args, err, -1, start)
|
r.logSQL(query, args, err, int64(reflect.ValueOf(response).Elem().Len()), start)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue