Changeset 6417 for code/trunk/src/libraries/util/OutputHandler.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/OutputHandler.cc
r6105 r6417 39 39 #include <cstdlib> 40 40 #include <fstream> 41 #include <iostream> 41 42 #include <sstream> 42 43 … … 76 77 #ifdef ORXONOX_PLATFORM_WINDOWS 77 78 char* pTempDir = getenv("TEMP"); 78 this->logFilename_ = std::string(pTempDir) + "/"+ logFileBaseName_g;79 this->logFilename_ = std::string(pTempDir) + '/' + logFileBaseName_g; 79 80 #else 80 81 this->logFilename_ = std::string("/tmp/") + logFileBaseName_g; … … 174 175 void outputChanged(int level) 175 176 { 176 // Read ostringstream and store it 177 this->output_.push_back(std::make_pair(level, this->buffer_.str())); 178 // Clear content and flags 179 this->buffer_.str(std::string()); 177 if (!this->buffer_.str().empty()) 178 { 179 // Read ostringstream and store it 180 this->output_.push_back(std::make_pair(level, this->buffer_.str())); 181 // Clear content and flags 182 this->buffer_.str(std::string()); 183 } 180 184 this->buffer_.clear(); 181 185 } … … 214 218 this->registerOutputListener(this->consoleWriter_); 215 219 216 this->output_ 220 this->output_ = new MemoryLogWriter(); 217 221 // We capture as much input as the listener with the highest level 218 222 this->output_->softDebugLevel_ = getSoftDebugLevel(); … … 224 228 { 225 229 delete this->logFile_; 230 delete this->consoleWriter_; 226 231 delete this->output_; 227 232 }
Note: See TracChangeset
for help on using the changeset viewer.