| 100 | } |
| 101 | |
| 102 | void GuiConsole::refreshLogText() |
| 103 | { |
| 104 | U32 size; |
| 105 | ConsoleLogEntry *log; |
| 106 | |
| 107 | Con::getLockLog(log, size); |
| 108 | |
| 109 | if (mFilteredLog.size() != size || mFiltersDirty) |
| 110 | { |
| 111 | mFilteredLog.clear(); |
| 112 | |
| 113 | U32 errorCount = 0; |
| 114 | U32 warnCount = 0; |
| 115 | U32 normalCount = 0; |
| 116 | |
| 117 | //Filter the log if needed |
| 118 | for (U32 i = 0; i < size; ++i) |
| 119 | { |
| 120 | ConsoleLogEntry &entry = log[i]; |
| 121 | |
| 122 | if (entry.mLevel == ConsoleLogEntry::Error) |
| 123 | { |
| 124 | errorCount++; |
| 125 | if (mDisplayErrors) |
| 126 | { |
| 127 | mFilteredLog.push_back(entry); |
| 128 | } |
| 129 | } |
| 130 | else if (entry.mLevel == ConsoleLogEntry::Warning) |
| 131 | { |
| 132 | warnCount++; |
| 133 | if (mDisplayWarnings) |
| 134 | { |
| 135 | mFilteredLog.push_back(entry); |
| 136 | } |
| 137 | } |
| 138 | else if (entry.mLevel == ConsoleLogEntry::Normal) |
| 139 | { |
| 140 | normalCount++; |
| 141 | if (mDisplayNormalMessages) |
| 142 | { |
| 143 | mFilteredLog.push_back(entry); |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | onNewMessage_callback(errorCount, warnCount, normalCount); |
| 149 | } |
| 150 | |
| 151 | Con::unlockLog(); |
| 152 | } |
| 153 | |
| 154 | //----------------------------------------------------------------------------- |
| 155 |
nothing calls this directly
no test coverage detected