Let $f$ be a modular cuspidal Hecke eigenform of weight $k$ and level $N$, and denote by $a_f(n)$ its $n$-th Fourier coefficient normalized so that $a_f(n) \ll \tau(n)$ the divisor function (Deligne bound). As a consequence of Rankin-Selberg theory, for any large $x$ we have $$ \sum_{p \leq x} \frac{a_f(p)^2}{p} = \log \log x + B + O(1/\log x), $$ where $B$ is a constant. What do we know about the dependence of $B$ and the implicit constant in the level aspect? Are they bounded in the level aspect, or at least not growing faster than $\log \log N$? (I would like to apply it with $x$ of size about $N$)
To state an analogue result, we can prove $$ \sum_{\substack{p \leq N}} \frac{a_f(p)^2}{p} \frac{\log(p)^2}{\log(N)^2} W\left( \frac{\log p}{\log N}\right) = B_W + O\left( \frac{\log\log N}{\log N}\right) $$ where $B_W$ only depends on $W$ but not on $f$, and the implicit constant in the error term is absolute. Is there a similar statement for the first sum above?