Example #1
0
        void AddLog(const char* lpFormat, ...)
        {
            const int nBufLen = MAX_PATH * 2;
            char szBuf[nBufLen + 1] = {0};
            va_list ap;
            va_start(ap, lpFormat);
            StringCchVPrintfA(szBuf, nBufLen, lpFormat, ap);
            va_end(ap);
            OutputDebugStringA(szBuf);

            std::wstring sTime = GetTimeHeader();
            std::string sLine = CW2A(sTime.c_str(), CP_UTF8).m_psz;
            sLine.append(szBuf);
            AddMsgToList(sLine);
        }
Example #2
0
    std::string ReportEventRecorder::GetHeader() const
    {
        std::stringstream header ;
        header << GetTimeHeader()           << ","
               << "Node_ID"                 << ","
               << "Event_Name"              << ","
               << "Individual_ID"           << ","
               << "Age"                     << ","
               << "Gender"                  << ","
               << "Infected"                << ","
               << "Infectiousness"          ;

        for (const auto& prop : properties_to_report)
        {
            header << "," << prop;
        }

        return header.str();
    }