Limit from UPB exam book 2014 $$\lim_{x \to 0^{+}} (\sin x)^{\cos x}\left(\frac{\cos^{2}x}{\sin x} - \sin x\log(\sin x)\right)$$

The answer is one, but i dont know how to proceed in solving the problem.
First note that instead of $x \to 0$ you must have $x \to 0^{+}$ otherwise both $\log\sin x$ and $(\sin x)^{\cos x}$ are undefined. The given expression can be expressed as $$(\sin x)^{\cos x - 1}\cos^{2}x - (\sin x)^{\cos x}\sin x\log\sin x$$ and limit of each term will be evaluated separately.

Now note that as $x \to 0^{+}$, $\cos x \to 1$ and $\log\sin x \to -\infty$ hence $\cos x \log \sin x \to -\infty$ and therefore $$(\sin x)^{\cos x} = \exp(\cos x \log \sin x) \to 0\tag{1}$$ Further note the standard result $$\lim_{t \to 0^{+}}t\log t = 0$$ and hence on putting $t = \sin x$ we get $$\lim_{x \to 0^{+}}\sin x \log \sin x = 0\tag{2}$$ It follows from $(1), (2)$ that $$\lim_{x \to 0^{+}}(\sin x)^{\cos x}\sin x\log \sin x = 0\tag{3}$$ We are now left with the term $$\lim_{x \to 0^{+}}(\sin x)^{\cos x - 1}\cos^{2}x$$ and since $\cos^{2}x \to 1$ we just need to calculate the limit of $(\sin x)^{\cos x - 1}$. This limit will be the final answer. Let it be $L$. Then
\begin{align}
\log L &amp;= \log\lim_{x \to 0^{+}}(\sin x)^{\cos x - 1}\notag\\
&amp;= \lim_{x \to 0^{+}}\log(\sin x)^{\cos x - 1}\text{ (by continuity of log)}\notag\\
&amp;= \lim_{x \to 0^{+}}(\cos x - 1)\log\sin x\notag\\
&amp;= \lim_{x \to 0^{+}}(\cos x - 1)\log\left(\frac{\sin x}{x}\cdot x\right)\notag\\
&amp;= \lim_{x \to 0^{+}}(\cos x - 1)\log\left(\frac{\sin x}{x}\right) + (\cos x - 1)\log x\notag\\
&amp;= 0\cdot \log 1 + \lim_{x \to 0^{+}}\frac{\cos^{2}x - 1}{\cos x + 1}\cdot\log x\notag\\
&amp;= -\frac{1}{2}\lim_{x \to 0^{+}}\sin^{2}x\log x\notag\\
&amp;= -\frac{1}{2}\lim_{x \to 0^{+}}\frac{\sin^{2}x}{x^{2}}\cdot x\cdot x\log x\notag\\
&amp;= -\frac{1}{2}\cdot 1\cdot 0\cdot 0 = 0\notag
\end{align}
It follows that $L = e^{0} = 1$.
$$\lim_{x\to 0 }x^{cos x-1}=1\\\lim_{x\to 0 }\frac{x^{cos x}}{x}=1\\ \xrightarrow[x \to 0]{sin x \approx  x} \lim_{x\to 0 }\frac{sin x^{cos x}}{x}=1 $$ name
 $u(x)=sinx ^{cos x}\\u'(x)=sinx ^{cos x} (\frac {cos^2x}{sinx}-sin x \ln sinx )$ 
now 
$$ \lim_{x\to 0 }\frac{sin x^{cos x}}{x}=1\\\lim_{x\to 0 }\frac{u(x)}{x}=\frac{0}{0}=1 $$ l'hosptial because ($\lim_{x\to 0 }sin x^{cos x}=0$ )

$$\lim_{x\to 0 }\frac{u(x)}{x}=\frac{U'(x)}{1}=1 \ \to \\ \lim_{x\to 0 }u'(x)=1 \\\lim_{x\to 0 }u'(x) =\lim_{x\to 0 }sinx ^{cos x}\\u'(x)=sinx ^{cos x} (\frac {cos^2x}{sinx}-sin x \ln sinx )=1 $$