Let \( f : \mathbb{R} \to \mathbb{R} \) be a function defined by \( f(x) = \log_{\sqrt{m}} \left\{ \sqrt{2}(\sin x - \cos x) + m - 2 \right\} \), for some \( m \), such that the range of \( f \) is \( [0,2] \). Then the value of \( m \) is _______.
\( 5 \)
\( 2 \)
\( 3 \)
\( 4 \)