Replace the insertion operator with snprintf

On Linux, the usage of insertion operator (<<) requires LIBCXX 3.4.9 which
is not always the case for some old enterprise systems.