Changeset 141 in pacpusframework for branches/2.0-beta1/src
- Timestamp:
- Jul 30, 2013, 5:48:06 PM (11 years ago)
- Location:
- branches/2.0-beta1/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/src/DBITEPlayerLib/DbtPlyFileManager.cpp
r89 r141 120 120 dbt.pfile->open(mDbtFilenameList.at(i).toStdString(), ReadMode); 121 121 } catch (DbiteException & e) { 122 (void) e; // unused 122 123 LOG_ERROR("cannot open DBT file \"" << mDbtFilenameList.at(i) << "\""); 123 124 LOG_DEBUG("error: " << e.what()); … … 179 180 void DbtPlyFileManager::displayUI() 180 181 { 181 //LOG_WARN("component '" << componentName << "' has no user interface. Please set ui property to 0 in your XML configuration");182 LOG_WARN("component '" << componentName << "' has no user interface. Please set ui property to 0 in your XML configuration"); 182 183 } 183 184 -
branches/2.0-beta1/src/FileLib/src/DbiteFile.cpp
r89 r141 95 95 checkFileOpen(); 96 96 } catch (DbiteException & e) { 97 (void) e; // unused 97 98 LOG_ERROR("Dbite exception: " << e.what()); 98 99 close(); … … 103 104 readHeader(); 104 105 } catch (DbiteException & e) { 106 (void) e; // unused 105 107 LOG_ERROR("Dbite exception: " << e.what()); 106 108 // TODO: readAndDiagnoseHeader(); … … 164 166 // TODO: check if same type and record size 165 167 } catch (DbiteException & e) { 168 (void) e; // unused 166 169 LOG_ERROR("Dbite exception: " << e.what()); 167 170 // TODO: readAndDiagnoseHeader(); … … 208 211 writeHeader(); 209 212 } catch (DbiteException & e) { 213 (void) e; // unused 210 214 LOG_ERROR("cannot write header on close: " << e.what()); 211 215 } -
branches/2.0-beta1/src/PacpusLib/ComponentManager.cpp
r120 r141 343 343 344 344 LOG_INFO("starting component '" << componentName << "'..."); 345 if (!component->startComponent()) 345 if (!component->startComponent()) { 346 346 LOG_WARN("cannot start component '" << componentName << "'. It can already be started"); 347 } 347 348 348 349 return true; … … 372 373 373 374 LOG_INFO("stopping component '" << componentName << "'..."); 374 if (!component->stopComponent()) 375 if (!component->stopComponent()) { 375 376 LOG_WARN("cannot stop component '" << componentName << "'" << ". It can be already stopped"); 377 } 376 378 377 379 return true; … … 383 385 384 386 ComponentMap::iterator it = componentMap_.find(name); 385 if (it != componentMap_.end()) 387 if (it != componentMap_.end()) { 386 388 return *it; 389 } 387 390 388 391 LOG_WARN("cannot retrieve component '" << name << "'" << ". It does not exist"); -
branches/2.0-beta1/src/PacpusLib/Log.cpp
r89 r141 9 9 #ifdef PACPUS_USE_LOG 10 10 11 #ifdef _MSC_VER 12 # pragma warning(push) 13 # pragma warning(disable: 4231 4251) 14 #endif // _MSC_VER 15 16 #include <log4cxx/basicconfigurator.h> 17 #include <log4cxx/consoleappender.h> 18 #include <log4cxx/patternlayout.h> 19 #include <log4cxx/propertyconfigurator.h> 11 #include <ostream> 20 12 #include <QString> 21 13 22 #ifdef _MSC_VER 23 # pragma warning(pop) 24 #endif // _MSC_VER 14 template< typename CharT, typename TraitsT > 15 std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream< CharT, TraitsT >& strm, QString const& s) 16 { 17 strm << s.toStdString(); 18 return strm; 19 } 25 20 26 using namespace log4cxx; 21 // explicit instantiation 22 template 23 PACPUSLIB_API std::basic_ostream<char>& operator<< (std::basic_ostream<char>& strm, QString const& s); 24 25 #endif // PACPUS_USE_LOG 27 26 28 27 namespace pacpus { 28 29 #if defined(PACPUS_USE_LOG) 29 30 30 static int niftyCounter; 31 //#include <boost/log/utility/setup/formatter_parser.hpp> 32 33 //void init_log_factories() 34 //{ 35 // //boost::log::register_simple_formatter_factory< QString, char >("QString"); 36 //} 37 38 #endif // PACPUS_USE_LOG 31 39 32 40 LogConfigurator::LogConfigurator() 33 41 { 34 using namespace log4cxx; 35 36 if (0 == niftyCounter++) { 37 BasicConfigurator::resetConfiguration(); 38 39 LayoutPtr lp(new PatternLayout(LOG4CXX_STR("%-6r [%-5p] %30.30c - %m%n"))); 40 AppenderPtr ap(new ConsoleAppender(lp)); 41 BasicConfigurator::configure(ap); 42 Logger::getRootLogger()->setLevel(log4cxx::Level::getInfo()); 43 } 44 } 45 46 LogConfigurator::~LogConfigurator() 47 { 48 if (0 == --niftyCounter) { 49 // clean up 50 } 51 } 52 53 void LogConfigurator::configureLoggerWithFile(const char * configFilename) 54 { 55 BasicConfigurator::resetConfiguration(); 56 PropertyConfigurator::configure(configFilename); 57 } 58 59 } // namespace pacpus 60 61 helpers::CharMessageBuffer & operator<<(helpers::CharMessageBuffer & os, const QString & val) 62 { 63 return os << val.toStdString(); 64 } 65 66 helpers::CharMessageBuffer & operator<<(helpers::MessageBuffer & os, const QString & val) 67 { 68 return os << val.toStdString(); 69 } 70 71 #else // PACPUS_USE_LOG 72 73 namespace pacpus { 74 75 LogConfigurator::LogConfigurator() 76 { 77 } 78 79 LogConfigurator::~LogConfigurator() 80 { 42 #if defined(PACPUS_USE_LOG) 43 //init_log_factories(); 44 #endif // PACPUS_USE_LOG 81 45 } 82 46 … … 86 50 87 51 } // namespace pacpus 88 89 #endif // PACPUS_USE_LOG -
branches/2.0-beta1/src/PacpusLib/PacpusApplication.cpp
r89 r141 84 84 return QApplication::notify(receiver, ev); 85 85 } catch(DbiteException & e) { 86 (void) e; // unused 86 87 LOG_ERROR("DbiteException thrown:" << e.what()); 87 88 } catch(std::exception & e) { 89 (void) e; // unused 88 90 LOG_ERROR("std::exception thrown:" << e.what()); 89 91 }
Note:
See TracChangeset
for help on using the changeset viewer.