void OnStackFrame(const wxStackFrame& frame) { string location = "[unknown location] "; if (frame.HasSourceLocation()) location = S_FMT("(%s:%d) ", frame.GetFileName(), frame.GetLine()); wxUIntPtr address = wxPtrToUInt(frame.GetAddress()); string func_name = frame.GetName(); if (func_name.IsEmpty()) func_name = S_FMT("[unknown:%d]", address); stack_trace.Append(S_FMT("%d: %s%s\n", frame.GetLevel(), location, func_name)); }
/* Console::logMessage * Prints a message to the console log *******************************************************************/ void Console::logMessage(string message) { // Add a newline to the end of the message if there isn't one if (message.size() == 0 || message.Last() != '\n') message.Append("\n"); // Log the message log.push_back(message); // Announce that a new message has been logged MemChunk mc; announce("console_logmessage", mc); }