void logger_delegate::output(uint32_t type, const char *origin, const char *fmt, ...) { char szBuff[8192]; // Strings longer than this get truncated va_list args; va_start(args, fmt); if ( vsnprintf(szBuff, sizeof(szBuff)-1, fmt, args) < 0) szBuff[sizeof(szBuff)-1] = '\0'; va_end(args); output_impl(type,origin,szBuff); }
std::ostream& operator<<(std::ostream& os, MZHeader const& header) { typedef build_indices<boost::fusion::result_of::size<MZHeader>::value>::type indices; return output_impl(os, header, indices{}); }
std::ostream& output_impl(std::ostream& os, const MZHeader& header, indices<I, Indices...>) { os << boost::fusion::extension::struct_member_name<MZHeader, I>::call() << ": "; output(os, boost::fusion::at_c<I>(header)); return output_impl(os, header, indices<Indices...>{}); }