Changeset 8777 for code/branches
- Timestamp:
- Jul 25, 2011, 2:47:49 PM (13 years ago)
- Location:
- code/branches/output/src/libraries/util
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/util/Output.h
r8765 r8777 40 40 using namespace level; 41 41 42 inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContext context = context::undefined)42 inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContextFunction context = context::undefined) 43 43 { 44 44 static OutputStream stream; -
code/branches/output/src/libraries/util/output/LogWriter.cc
r8776 r8777 83 83 84 84 if (this->bDefaultPath_) 85 OutputManager::getInstance().pushMessage(level::user_info, context::output , "Opening log file " + name);85 OutputManager::getInstance().pushMessage(level::user_info, context::output(), "Opening log file " + name); 86 86 87 87 this->file_.open(name.c_str(), std::fstream::out); … … 90 90 this->printLine("Log file opened"); 91 91 else 92 OutputManager::getInstance().pushMessage(level::user_warning, context::output , "Failed to open log file. File logging disabled.");92 OutputManager::getInstance().pushMessage(level::user_warning, context::output(), "Failed to open log file. File logging disabled."); 93 93 } 94 94 … … 104 104 void LogWriter::setLogPath(const std::string& path) 105 105 { 106 OutputManager::getInstance().pushMessage(level::internal_info, context::output , "Migrating log file from " + this->path_ + "\nto " + path);106 OutputManager::getInstance().pushMessage(level::internal_info, context::output(), "Migrating log file from " + this->path_ + "\nto " + path); 107 107 108 108 this->closeFile(); -
code/branches/output/src/libraries/util/output/MemoryWriter.cc
r8776 r8777 67 67 { 68 68 OutputManager::getInstance().unregisterListener(this); 69 this->output(level::debug_output, context::undefined , std::vector<std::string>(1, "MemoryWriter disabled, further messages may be lost"));69 this->output(level::debug_output, context::undefined(), std::vector<std::string>(1, "MemoryWriter disabled, further messages may be lost")); 70 70 } 71 71 } -
code/branches/output/src/libraries/util/output/OutputDefinitions.h
r8774 r8777 58 58 59 59 typedef uint64_t OutputContext; 60 typedef OutputContext (OutputContextFunction)(); 60 61 61 62 extern _UtilExport OutputContext registerContext(const std::string& name); … … 65 66 static const OutputContext all = 0xFFFFFFFFFFFFFFFF; 66 67 static const OutputContext none = 0x0000000000000000; 67 static const OutputContext undefined = registerContext("undefined");68 68 69 static const OutputContext test1 = registerContext("test1"); 70 static const OutputContext test2 = registerContext("test2"); 71 static const OutputContext output = registerContext("output"); 69 namespace 70 { 71 OutputContext undefined() { static OutputContext value = registerContext("undefined"); return value; } 72 73 OutputContext test1() { static OutputContext value = registerContext("test1"); return value; } 74 OutputContext test2() { static OutputContext value = registerContext("test2"); return value; } 75 OutputContext output() { static OutputContext value = registerContext("output"); return value; } 76 } 72 77 } 73 78 } -
code/branches/output/src/libraries/util/output/OutputManager.cc
r8776 r8777 180 180 const std::string& OutputManager::getContextName(OutputContext context) const 181 181 { 182 if (context != context::undefined )182 if (context != context::undefined()) 183 183 { 184 184 boost::bimap<OutputContext, std::string>::left_map::const_iterator it = this->contexts_.left.find(context); … … 214 214 { 215 215 std::string prefix = this->getLevelName(level) + ": "; 216 if (context != context::undefined )216 if (context != context::undefined()) 217 217 { 218 218 std::string context_name = this->getContextName(context); -
code/branches/output/src/libraries/util/output/OutputStream.cc
r8776 r8777 48 48 } 49 49 50 void OutputStream::setOutputAttributes(OutputLevel level, OutputContext context)50 void OutputStream::setOutputAttributes(OutputLevel level, OutputContextFunction context) 51 51 { 52 52 this->level_ = level; 53 this->context_ = context ;53 this->context_ = context(); 54 54 55 this->bAcceptsOutput_ = OutputManager::getInstanceAndCreateListeners().acceptsOutput( level, context);55 this->bAcceptsOutput_ = OutputManager::getInstanceAndCreateListeners().acceptsOutput(this->level_, this->context_); 56 56 } 57 57 } -
code/branches/output/src/libraries/util/output/OutputStream.h
r8771 r8777 47 47 _UtilExport OutputStream(); 48 48 49 void _UtilExport setOutputAttributes(OutputLevel level, OutputContext context);49 void _UtilExport setOutputAttributes(OutputLevel level, OutputContextFunction context); 50 50 51 51 template <class T>
Note: See TracChangeset
for help on using the changeset viewer.