Help to evaluate $\int_{0}^{\pi}\sec(x)\sqrt{\tan\left(\frac{x}{2}\right)}\ln^n\tan\left(\frac{x}{2}\right)dx$

Split the integral at $v=1$ and let $v \to \frac{1}{v}$ in the second integral to obtain $$ I_n \equiv - 2 \int \limits_0^\infty \frac{\sqrt{v} \ln^n (v)}{v^2 - 1} \, \mathrm{d} v = -2 \int \limits_0^1 \frac{[- \ln(v)]^n}{1-v^2} \left[v^{-1/2} + (-1)^{n-1} v^{1/2}\right] \, \mathrm{d} v \, . $$ Now let $v = \mathrm{e}^{-t}$ and expand the denominator into a geometric series: $$ I_n = -2 \int \limits_0^\infty t^n \sum \limits_{l=0}^\infty \mathrm{e}^{-(2l+1)t} \left[\mathrm{e}^{t/2} + (-1)^{n-1} \mathrm{e}^{-t/2}\right] \, \mathrm{d} t \, . $$ Interchange summation and integration (monotone convergence theorem), make linear substitutions in the exponents and use the definition of the gamma function to find $$ I_n = -2 n! \sum \limits_{l=0}^\infty \left[\frac{1}{\left(2l + \frac{1}{2}\right)^{n+1}} + \frac{(-1)^{n-1}}{\left(2l + \frac{3}{2}\right)^{n+1}}\right] = - 2^{n+2} n! \sum \limits_{m=0}^\infty \frac{(-1)^{(n-1) m}}{(2m+1)^{n+1}} \, .$$ For odd values of $n$ the sum is given by the Dirichlet lambda function: \begin{align} I_{2k-1} &= -2^{2k+1} (2k-1)! \lambda (2k) = -2^{2k+1} (2k-1)! \left(1-2^{-2k}\right) \zeta (2k) \\ &= - \frac{4^k (4^k-1) \lvert \mathrm{B}_{2k} \rvert}{2 k} \pi^{2k} \, , \, k \in \mathbb{N} \, . \end{align} $\mathrm{B}_{2k}$ are the Bernoulli numbers. For even $n$ one can use the Dirichlet beta function: $$I_{2k} = - 2^{2k+2} (2k)! \beta(2k+1) = - \lvert \mathrm{E}_{2k} \rvert \pi^{2k+1} \, , \, k \in \mathbb{N} \, . $$ $\mathrm{E}_{2k}$ are the Euler numbers. In general, your integral is given by $$ I_n = - a_n \pi^{n+1} \, , \, n \in \mathbb{N} \, ,$$ where $(a_n)_{n \in \mathbb{N}_0}$ is this sequence.

Note that these results suggest $I_0 = - \pi$, which is indeed true if we take the Cauchy principal value: $$ I_0 \equiv - 2 \operatorname{PV} \int \limits_0^\infty \frac{\sqrt{v}}{v^2 - 1} \, \mathrm{d} v = -2 \int \limits_0^1 \frac{\mathrm{d}v}{\sqrt{v} (1+v)} = - 4 \int \limits_0^1 \frac{\mathrm{d}w}{1+w^2} = - \pi \, . $$