Replace the insertion operator with snprintf

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