Changeset 1586 for code/branches/core3/src/util/OutputHandler.cc
- Timestamp:
- Jun 10, 2008, 3:35:50 PM (17 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/util/OutputHandler.cc
r1574 r1586 33 33 34 34 #include "OutputHandler.h" 35 #include "Core.h"36 #include "ConsoleCommand.h"37 #include "Shell.h"38 35 39 36 namespace orxonox 40 37 { 41 SetConsoleCommandShortcutGeneric(log, createConsoleCommand(createFunctor(&OutputHandler::log), "log" ));42 SetConsoleCommandShortcutGeneric(error, createConsoleCommand(createFunctor(&OutputHandler::error), "error" ));43 SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));44 SetConsoleCommandShortcutGeneric(info, createConsoleCommand(createFunctor(&OutputHandler::info), "info" ));45 SetConsoleCommandShortcutGeneric(debug, createConsoleCommand(createFunctor(&OutputHandler::debug), "debug" ));46 47 38 /** 48 39 @brief Constructor: Opens the logfile and writes the first line. … … 51 42 OutputHandler::OutputHandler(const std::string& logfilename) 52 43 { 44 this->outputBuffer_ = &this->fallbackBuffer_; 45 this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2; 53 46 this->logfilename_ = logfilename; 54 47 this->logfile_.open(this->logfilename_.c_str(), std::fstream::out); … … 77 70 78 71 /** 72 @brief Sets the soft debug level for a given output device. 73 @param device The output device 74 @param level The debug level 75 */ 76 void OutputHandler::setSoftDebugLevel(OutputHandler::OutputDevice device, int level) 77 { 78 OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device] = level; 79 } 80 81 /** 79 82 @brief Returns the soft debug level for a given output device. 80 83 @param device The output device … … 83 86 int OutputHandler::getSoftDebugLevel(OutputHandler::OutputDevice device) 84 87 { 85 return Core::getSoftDebugLevel(device);88 return OutputHandler::getOutStream().softDebugLevel_[(unsigned int)device]; 86 89 } 87 90 88 91 /** 89 @brief Returns the Shell's OutputBuffer. This is mere placed here to avoid 90 recompiling the entire project when Shell.h changes. 91 @return The OutputBuffer of the Shell 92 @brief Sets the OutputBuffer, representing the third output stream. 93 @param buffer The OutputBuffer 92 94 */ 93 OutputBuffer& OutputHandler::getShellOutputBuffer()95 void OutputHandler::setOutputBuffer(OutputBuffer& buffer) 94 96 { 95 return Shell::getInstance().getOutputBuffer(); 97 buffer.getStream() >> this->outputBuffer_->getStream().rdbuf(); 98 this->outputBuffer_ = &buffer; 96 99 } 97 100 … … 113 116 114 117 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 115 Shell::getInstance().getOutputBuffer() << sb;118 (*this->outputBuffer_) << sb; 116 119 117 120 return *this; … … 135 138 136 139 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 137 Shell::getInstance().getOutputBuffer() << manipulator;140 (*this->outputBuffer_) << manipulator; 138 141 139 142 return *this; … … 157 160 158 161 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 159 Shell::getInstance().getOutputBuffer() << manipulator;162 (*this->outputBuffer_) << manipulator; 160 163 161 164 return *this; … … 179 182 180 183 if (OutputHandler::getSoftDebugLevel(OutputHandler::LD_Shell) >= this->outputLevel_) 181 Shell::getInstance().getOutputBuffer() << manipulator;184 (*this->outputBuffer_) << manipulator; 182 185 183 186 return *this;
Note: See TracChangeset
for help on using the changeset viewer.