log() and CCLOG() follow the printf() formatting rules. See this cheatsheet.
It’s pretty straightforward but note that this API is really a C API and not a C++ API so therefore won’t handle C++ objects. If you want to print the contents of a std::string (a standard C++ string) then you need to pass the C const char * via the c_str() method:
std::string s = "world";
log("hello %s", s.c_str());