Step 1: Solving the differential equation.
Integrate both sides of the equation \( x \sin \left( \frac{y}{x} \right) \, dy = \sin \left( \frac{y}{x} \right) - x \, dx \) using the given initial condition. The solution leads to \( \cos \left( \frac{y}{x} \right) = \log x \).
Step 2: Conclusion.
Thus, the correct answer is option (C).
Final Answer:
\[
\boxed{\text{(C) } \log x}
\]