void testObj::test<8>(void) { if(true) LOGMSG_DEBUG(n_, "true logged 1"); else LOGMSG_DEBUG(n_, "false logged 1"); ensureNotLoggedPart("true logged 1"); ensureNotLoggedPart("false logged 1"); }
QueueRestorer::QueueRestorer(Persistency::IO::ConnectionPtrNN conn, Core::Types::SignedNodesFifo &queue) { const Logger::Node log("core.queuerestorer"); try { LOGMSG_INFO(log, "restoring data base's content"); // preapre environment assert( conn.get()!=NULL ); Transaction t( conn->createNewTransaction("meta_alerts_queue_restore") ); RestorerAutoPtr rest=conn->restorer(t); // read data base content Restorer::NodesVector tmp; LOGMSG_DEBUG(log, "reading meta-alerts"); rest->restoreAllInUse(tmp); t.commit(); // add all elements to queue LOGMSG_DEBUG_S(log)<<tmp.size()<<" meta-alerts read from persistency; appending to queue"; for(Restorer::NodesVector::const_iterator it=tmp.begin(); it!=tmp.end(); ++it) queue.push( Types::SignedNode(*it, TypeName(CC::defaultInputTypeName), InstanceName(CC::defaultInputInstanceName) ) ); LOGMSG_INFO_S(log)<<"restoring "<<tmp.size()<<" elements successful"; } catch(const std::exception &ex) { LOGMSG_ERROR_S(log)<<"unable to restore data base's content; error was: " <<ex.what()<<"; continuing any way..."; } }
void testObj::test<13>(void) { const Node log("subtree1.subthreshold"); const char *msg="hello warn 13"; LOGMSG_DEBUG(log, msg); ensureNotLoggedPart(msg); }
void testObj::test<12>(void) { const Node log("root"); const char *msg="hello debug 12"; LOGMSG_DEBUG(log, msg); ensureLoggedPart(msg); ensureLoggedPart("DEBUG@"); }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); Logging::CLoggerFactory::getDefaultInstance()->AddTarget(new Logging::CLogTargetDebugger(Logging::LOG_LEVEL_INFO)); Logging::CLoggerFactory::getDefaultInstance()->AddTarget(new Logging::CLogTargetMessageBox(Logging::LOG_LEVEL_ERROR)); LOGMSG_DEBUG(_T("Application started.\n")); ::CoInitialize(NULL); _Module.Init(NULL, hInstance); CDxWindow win; if (!win.CreateEx()) { LOGMSG_ERROR(_T("Failed to create main window!\n")); return 1; // Window creation failed } win.ShowWindow(nCmdShow); win.UpdateWindow(); // Hauptmeldungsschleife: MSG msg; bool bDone = false; while (!bDone) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) bDone = true; TranslateMessage(&msg); DispatchMessage(&msg); } else { win.Render(); } } ::CoUninitialize(); LOGMSG_DEBUG(_T("Application finished.\n")); return (int)msg.wParam; }
void testObj::test<1>(void) { LOGMSG_DEBUG(*this, "test"); ensureCalls(0); }