| 170 | } |
| 171 | |
| 172 | void LogStreamBuf::clearCache() |
| 173 | { |
| 174 | // if there are any streams in our list, we |
| 175 | // copy the line into that streams, too and flush them |
| 176 | map<std::string, LogCacheStruct>::iterator it = log_cache_.begin(); |
| 177 | |
| 178 | for (; it != log_cache_.end(); ++it) |
| 179 | { |
| 180 | if ((it->second).counter != 0) |
| 181 | { |
| 182 | std::stringstream stream; |
| 183 | stream << "<" << it->first << "> occurred " << ++(it->second).counter << " times"; |
| 184 | distribute_(stream.str()); |
| 185 | } |
| 186 | } |
| 187 | // remove all entries from cache |
| 188 | log_cache_.clear(); |
| 189 | log_time_cache_.clear(); |
| 190 | } |
| 191 | |
| 192 | void LogStreamBuf::distribute_(const std::string& outstring) |
| 193 | { |
no test coverage detected