A convenient logging statement for C++ using boost::format
问题 I want to design a logging function with the following characteristics: based on std::string rather than char* supports variable number of variables, like printf accepts as first parameter a severity level avoids formatting overhead when severity level is below logging level as simple as printf, or nearly so I'm inclined to use boost::format because of its automatic type conversion. But here are some problems I see: Its syntax is a little awkward: format("Mgr %s on pid %d is in state %s" %