void logWarning(const char* format, ...) { va_list vl; va_start(vl, format); string message = "Warning: " + vlformat(format, vl); va_end(vl); printColorized(&std::cerr, message, ANSI_YELLOW); PROFILER_LOG(message.c_str()); }
void logInfo(const char* format, ...) { va_list vl; va_start(vl, format); string message = vlformat(format, vl); va_end(vl); printColorized(&std::cout, message, ANSI_GREEN); PROFILER_LOG(message.c_str()); }
void logError(const char* format, ...) { va_list vl; va_start(vl, format); string message = "ERROR: " + vlformat(format, vl); va_end(vl); printColorized(&std::cerr, message, ANSI_RED); PROFILER_LOG(message.c_str()); }
void TimeProfiler::report() const { PROFILER_LOG(info,"Profiler report: " << mName << " (" << mContext->recentSimTime()-Time::null() << ")"); // Group stages for(GroupMap::const_iterator git = mGroups.begin(); git != mGroups.end(); git++) { String group_name = git->first; const StageList& stages = git->second; PROFILER_LOG(info,"Group: " << group_name); for(StageList::const_iterator it = stages.begin(); it != stages.end(); it++) { Stage* stage = *it; stage->report("-"); } } // Free stages for(StageList::const_iterator it = mFreeStages.begin(); it != mFreeStages.end(); it++) { Stage* stage = *it; stage->report(""); } }
void panic(const char* format, ...) { va_list vl; va_start(vl, format); string message = "PANIC: " + vlformat(format, vl); va_end(vl); printColorized(&std::cerr, message, ANSI_RED); PROFILER_LOG(message.c_str()); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", message.c_str(), NULL); exit(EXIT_FAILURE); }
void TimeProfiler::Stage::report(const String& indent) const { PROFILER_LOG(info,"Stage: " << indent << name() << " -- Avg: " << avg() << " Min: " << minimum() << " Max:" << maximum() << " Sum: " << mSum << " Its: " << its()); }