- Timestamp:
- Jul 25, 2011, 8:03:05 PM (13 years ago)
- Location:
- code/branches/output/src/libraries/util
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/util/CMakeLists.txt
r8774 r8780 43 43 output/OutputManager.cc 44 44 output/OutputListener.cc 45 output/ConsoleWriter.cc 45 46 output/LogWriter.cc 46 47 output/MemoryWriter.cc -
code/branches/output/src/libraries/util/output/OutputManager.cc
r8777 r8780 29 29 #include "OutputManager.h" 30 30 31 #include "util/Debug.h"32 #include "OutputListener.h"33 31 #include "MemoryWriter.h" 32 #include "ConsoleWriter.h" 34 33 #include "LogWriter.h" 35 34 … … 38 37 namespace test 39 38 { 40 class ConsoleOutput : public OutputListener41 {42 public:43 ConsoleOutput()44 {45 this->setLevelMax(level::user_info);46 }47 48 protected:49 virtual void output(OutputLevel level, OutputContext context, const std::vector<std::string>& lines)50 {51 const std::string& prefix = OutputManager::getInstance().getDefaultPrefix(level, context);52 std::string blanks(prefix.length(), ' ');53 54 for (size_t i = 0; i < lines.size(); ++i)55 COUT(0) << (i == 0 ? prefix : blanks) << lines[i] << endl;56 }57 };58 59 39 OutputManager::OutputManager() 60 40 { … … 77 57 static OutputManager& instance = OutputManager::getInstance(); 78 58 79 static ConsoleOutput consoleOutputInstance;80 59 static MemoryWriter& memoryWriterInstance = MemoryWriter::getInstance(); (void)memoryWriterInstance; 60 static ConsoleWriter& consoleWriterInstance = ConsoleWriter::getInstance(); (void)consoleWriterInstance; 81 61 static LogWriter& logWriterInstance = LogWriter::getInstance(); (void)logWriterInstance; 82 62 … … 153 133 OutputContext registerContext(const std::string& name) 154 134 { 155 COUT(0) << "### register context " << name << std::endl;156 135 return OutputManager::getInstance().registerContext(name); 157 136 }
Note: See TracChangeset
for help on using the changeset viewer.