Example #1
0
void BANDB::openDB(char* dbName, char* logName) {
	// Start buffer and log managers
	bm->start(dbName);
	lm->start(logName);
	// Now the log manager has done all txnTable rebuilding and
	// all redo work, so we can rollback incomplete Txns
	for (int i = 0; i < 255; i++) {
		TxnRecord rec = lm->txnTable.records[i];
		if (rec.transID != 0) {
			// For all the transactions
			if (rec.state == 3) {
				// If it is committed but not ended, write the end record
				lm->writeEndRecord(rec.transID);
			}
			else if (rec.state != 5) {
				// Otherwise, if it is not an ended Txn, its a looser
				rollbackWork(rec.transID);
				lm->writeEndRecord(rec.transID);
			}
		}
	}
	// Harden All Pages
	bm->pageOut(0);
	bm->pageOut(1);
}
Example #2
0
void PhotonGrid::printPhotonMap(const char *LoggerName) {
	LogManager *log = LogManager::getSingletonPtr();
	char outputBuffer[2000];
	log->logMessage("-------------------------------------------", LoggerName);
	log->logMessage("Photon Grid Statistics", LoggerName);
	log->logMessage("-------------------------------------------", LoggerName);
	//sprintf(outputBuffer, "Time to build:\t%d seconds, %d milliseconds", (int)timeBuild, (int)((timeBuild - floor(timeBuild)) * 1000));
	//log->logMessage(outputBuffer, LoggerName);
	sprintf(outputBuffer, "Photons requested:\t%d", m_nPhotons + m_nPhotonsMissed);
	log->logMessage(outputBuffer, LoggerName);
	sprintf(outputBuffer, "Photons in map:\t%d", m_nPhotons );
	log->logMessage(outputBuffer, LoggerName);
	sprintf(outputBuffer, "Photons missed:\t%d", m_nPhotonsMissed);
	log->logMessage(outputBuffer, LoggerName);
	sprintf(outputBuffer, "Grid dimensions:\t%d x %d x %d Voxels, %.3f x %.3f x %.3f per Voxel", 
			gridDimension[0], gridDimension[1], gridDimension[2],
			gridDelta[0], gridDelta[1], gridDelta[2]);
	log->logMessage(outputBuffer, LoggerName);
#ifndef _GRID_HASH
	sprintf(outputBuffer, "Memory usage:\tGrid: %d KB\tMask: %d KB", 
		    int(gridDimension[0] * gridDimension[1] * gridDimension[2] * sizeof(GridPhoton)) / 1024,
			m_nGridBlocks / (8 * 1024));
	log->logMessage(outputBuffer, LoggerName);
#else
	m_pGrid.printStats(LoggerName);
#endif

	sprintf(outputBuffer, "Blocks:\t%d / %d blocks used", m_nGridBlocksUsed, m_nGridBlocks);	
	log->logMessage(outputBuffer, LoggerName);
}
Example #3
0
void GLscene::updateScene()
{
    if (m_log->index()<0) return;

#ifdef USE_COLLISION_STATE
    LogManager<OpenHRP::CollisionDetectorService::CollisionState> *lm
        = (LogManager<OpenHRP::CollisionDetectorService::CollisionState> *)m_log;
    GLbody *glbody = dynamic_cast<GLbody *>(body(0).get());
    OpenHRP::CollisionDetectorService::CollisionState &co = lm->state();
    if (co.angle.length() == glbody->numJoints()){
        for (int i=0; i<glbody->numJoints(); i++){
            GLlink *j = (GLlink *)glbody->joint(i);
            if (j){
                j->setQ(co.angle[i]);
            }
        }
    }
#else
    LogManager<TimedPosture> *lm 
        = (LogManager<TimedPosture> *)m_log;
    GLbody *glbody = dynamic_cast<GLbody *>(body(0).get());
    TimedPosture &ts = lm->state();
    if (ts.posture.size() == glbody->numJoints()){
        for (int i=0; i<glbody->numJoints(); i++){
            GLlink *j = (GLlink *)glbody->joint(i);
            if (j){
                j->setQ(ts.posture[i]);
            }
        }
    }
#endif
}
 static void SetUpTestCase() {
     logManager.BeginLogging(__FILE__ ".log", HLOG_ALL);
     logManager.BeginLogging("//stderr",
                             logManager.GetSingleLevelFromString("UPTO_DEBUG"),
                             HLOG_FORMAT_SIMPLE | HLOG_FORMAT_THREAD);
     hlog(HLOG_DEBUG, "Starting test...");
 }
void PageCoreTests::setUp()
{
    // set up silent logging to not pollute output
	if(LogManager::getSingletonPtr())
		OGRE_DELETE Ogre::LogManager::getSingletonPtr();

	if(LogManager::getSingletonPtr() == 0)
	{
		LogManager* logManager = OGRE_NEW LogManager();
		logManager->createLog("testPageCore.log", true, false);
	}
    LogManager::getSingleton().setLogDetail(LL_LOW);

#if OGRE_STATIC
        mStaticPluginLoader = OGRE_NEW StaticPluginLoader();
#endif

#ifdef OGRE_STATIC_LIB
	mRoot = OGRE_NEW Root(StringUtil::BLANK);
        
	mStaticPluginLoader.load();
#else
	mRoot = OGRE_NEW Root();
#endif

    LogManager::getSingleton().setLogDetail(LL_LOW);
	mPageManager = OGRE_NEW PageManager();

	// make certain the resource location is NOT read-only
	ResourceGroupManager::getSingleton().addResourceLocation("./", "FileSystem",
	    ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, false, false);

	mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

}
void GLscene::updateScene()
{ 
    if (m_log->index()<0) return;

    LogManager<OpenHRP::WorldState> *lm 
        = (LogManager<OpenHRP::WorldState> *)m_log;
    OpenHRP::WorldState &state = lm->state();
    for (unsigned int i=0; i<state.characterPositions.length(); i++){
        const CharacterPosition& cpos = state.characterPositions[i];
        std::string cname(cpos.characterName);
        GLbody *glbody = dynamic_cast<GLbody *>(body(cname).get());
        if (!glbody) {
            //std::cerr << "can't find a body named " << cname << std::endl;
            continue;
        }
        for (unsigned int j=0; j<cpos.linkPositions.length(); j++){
            const LinkPosition &lp = cpos.linkPositions[j];
            double T[] = {lp.R[0], lp.R[3], lp.R[6],0,
                          lp.R[1], lp.R[4], lp.R[7],0,
                          lp.R[2], lp.R[5], lp.R[8],0,
                          lp.p[0], lp.p[1], lp.p[2],1};
#if 0
            for (int i=0; i<4; i++){
                for (int j=0; j<4; j++){
                    printf("%6.3f ", T[i*4+j]);
                }
                printf("\n");
            }
            printf("\n");
#endif
            ((GLlink *)glbody->link(j))->setAbsTransform(T);
        }
    }
}
Example #7
0
int main(int argc, char *argv[]) {

    LogManager logManager;
    if (!logManager.init()) {
        std::cerr << "Logger init failed! Exiting.." << std::endl;
        exit(EXIT_FAILURE);
    }
    
    //TODO: use sigaction for portability
    signal(SIGPIPE, SIG_IGN);

    if (argc == 1) {
        usage();
    } else if ( argc >= 2 &&
                (!strncmp(argv[1], "-v", strlen("-v")) || !strncmp(argv[1], "--version", strlen("--version"))) ) {
        LOG(INFO) << "Version: " << RTT_TRACER_VERSION << std::endl;
        exit(EXIT_SUCCESS);
    }

    LOG(INFO) << "RTT Tracer version " << RTT_TRACER_VERSION << " starting.." << std::endl;

    if (argc == 3 && !strncmp(argv[1], "-s", strlen("-s"))) {
        RttTcpServer server(atoi(argv[2]));
        server.start();
    } else if (argc == 4 && !strncmp(argv[1], "-c", strlen("-c"))) {
        RttTcpClient client(std::string(argv[2]), atoi(argv[3]));
        client.start();
    } else {
        usage();
    }
}
bool ProjectTemplateLoader::Open(const wxString& filename)
{
    LogManager* pMsg = Manager::Get()->GetLogManager();
    if (!pMsg)
        return false;

//    pMsg->DebugLog(_T("Reading template file %s"), filename.c_str());

    TiXmlDocument doc(filename.mb_str());
    if (!doc.LoadFile())
        return false;

    TiXmlElement* root;

    root = doc.FirstChildElement("CodeBlocks_template_file");
    if (!root)
    {
        // old tag
        root = doc.FirstChildElement("Em::Blocks_template_file");
        if (!root)
        {
            pMsg->DebugLog(_T("Not a valid Em::Blocks template file..."));
            return false;
        }
    }

    DoTemplate(root);

    return true;
}
Example #9
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    system_init();
    if (DxLib_Init() == -1 || SetDrawScreen(DX_SCREEN_BACK) != 0)return -1; // 初期化と裏画面化

    game_init();


    LogSP log1 = LogSP(new Log("あいうえお"));
    LogSP log2 = LogSP(new Log("かきくけこ"));
    LogSP log3 = LogSP(new Log("さしすせそ"));
    manager.push(log1);
    manager.push(log2);
    manager.push(log3);


    while (ProcessLoop())
    {
        mso::KeyBoard::SetNowState();

        manager.process();

        mso::FpsController::Wait();
        mso::FpsController::Draw();

        ScreenFlip(); // 裏画面反映

        mso::KeyBoard::KeepPrevState();
    }


    DxLib_End();
    return 0;
}
Example #10
0
bool MSVC10Loader::DoCreateConfigurations()
{
    LogManager* pMsg = Manager::Get()->GetLogManager();
    if (!pMsg) return false;

    bool bResult = false;

    // create the project targets
    for (HashProjectsConfs::iterator it = m_pc.begin(); it != m_pc.end(); ++it)
    {
        ProjectBuildTarget* bt = m_pProject->AddBuildTarget(it->second.sName);
        if (bt)
        {
            bt->SetCompilerID(m_pProject->GetCompilerID());
            bt->AddPlatform(spAll); // target all platforms, SupportedPlatforms enum in "globals.h"

            TargetType tt = ttExecutable;
            if      (it->second.TargetType == _T("Application"))    tt = ttExecutable;
            else if (it->second.TargetType == _T("Console"))        tt = ttConsoleOnly;
            else if (it->second.TargetType == _T("StaticLibrary"))  tt = ttStaticLib;
            else if (it->second.TargetType == _T("DynamicLibrary")) tt = ttDynamicLib;
            else
                pMsg->DebugLog(_("Import; Unsupported target type: ") + it->second.TargetType);

            bt->SetTargetType(tt); // executable by default, TargetType enum in "globals.h"
            it->second.bt = bt; // apply

            pMsg->DebugLog(_("Created project build target: ") + it->second.sName);

            bResult = true; // at least one config imported
        }
    }

    return bResult;
}
Example #11
0
UI::EventReturn LogConfigScreen::OnDisableAll(UI::EventParams &e) {
	LogManager *logMan = LogManager::GetInstance();
	for (int i = 0; i < LogManager::GetNumChannels(); i++) {
		LogChannel *chan = logMan->GetLogChannel((LogTypes::LOG_TYPE)i);
		chan->enabled = false;
	}
	return UI::EVENT_DONE;
}
Example #12
0
void GLscene::showStatus()
{
    char buf[256];

    GLbody *glbody = dynamic_cast<GLbody *>(body(0).get());
    int width = m_width - 220;
#define HEIGHT_STEP 12
    int height = m_height-HEIGHT_STEP;
    int x = width;

    for (int i=0; i<glbody->numLinks(); i++){
        hrp::Link *l = glbody->link(i);
        if (l){
            sprintf(buf, "%13s %4d tris",
                    l->name.c_str(),
                    l->coldetModel->getNumTriangles());
            glRasterPos2f(x, height);
            drawString(buf);
            height -= HEIGHT_STEP;
        }
    }

    if (m_log->index()<0) return;

    LogManager<OpenHRP::CollisionDetectorService::CollisionState> *lm
        = (LogManager<OpenHRP::CollisionDetectorService::CollisionState> *)m_log;
    OpenHRP::CollisionDetectorService::CollisionState &co = lm->state();

    height -= HEIGHT_STEP;

    x = width - 34;
    sprintf(buf, "Number of pair     %8d",  co.lines.length());
    glRasterPos2f(x, height);
    drawString(buf);
    height -= HEIGHT_STEP;

    sprintf(buf, "Calc Time [msec]   %8.3f",  co.computation_time);
    glRasterPos2f(x, height);
    drawString(buf);
    height -= HEIGHT_STEP;

    sprintf(buf, "Recover Time[msec] %8.3f",  co.recover_time);
    glRasterPos2f(x, height);
    drawString(buf);
    height -= HEIGHT_STEP;

    sprintf(buf, "Safe Posture       %8s",  co.safe_posture?"true":"false");
    glRasterPos2f(x, height);
    drawString(buf);
    height -= HEIGHT_STEP;

    sprintf(buf, "Loop for check     %8d",  co.loop_for_check);
    glRasterPos2f(x, height);
    drawString(buf);
    height -= HEIGHT_STEP;

}
Example #13
0
void TerrainTests::setUp()
{
    // set up silent logging to not pollute output
	if(LogManager::getSingletonPtr())
		OGRE_DELETE Ogre::LogManager::getSingletonPtr();

	if(LogManager::getSingletonPtr() == 0)
	{
		LogManager* logManager = OGRE_NEW LogManager();
		logManager->createLog("testTerrain.log", true, false);
	}
    LogManager::getSingleton().setLogDetail(LL_LOW);
    mFSLayer = OGRE_NEW_T(Ogre::FileSystemLayer, Ogre::MEMCATEGORY_GENERAL)(OGRE_VERSION_NAME);

#ifdef OGRE_STATIC_LIB
	mRoot = OGRE_NEW Root(BLANKSTRING);
        
	mStaticPluginLoader.load();
#else
    String pluginsPath = mFSLayer->getConfigFilePath("plugins.cfg");
	mRoot = OGRE_NEW Root(pluginsPath);
#endif
	mTerrainOpts = OGRE_NEW TerrainGlobalOptions();

	// Load resource paths from config file
	ConfigFile cf;
    String resourcesPath;
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
#else
    resourcesPath = mFSLayer->getConfigFilePath("bin/resources.cfg");
#endif

    cf.load(resourcesPath);

	// Go through all sections & settings in the file
	ConfigFile::SectionIterator seci = cf.getSectionIterator();

	String secName, typeName, archName;
	while (seci.hasMoreElements())
	{
		secName = seci.peekNextKey();
		ConfigFile::SettingsMultiMap *settings = seci.getNext();
		ConfigFile::SettingsMultiMap::iterator i;
		for (i = settings->begin(); i != settings->end(); ++i)
		{
			typeName = i->first;
			archName = i->second;
			ResourceGroupManager::getSingleton().addResourceLocation(
				archName, typeName, secName);

		}
	}

	mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

}
Example #14
0
void ToDoList::OnAttach()
{
    // create ToDo in bottom view
    wxArrayString titles;
    wxArrayInt widths;
    titles.Add(_("Type")); widths.Add(64);
    titles.Add(_("Text")); widths.Add(320);
    titles.Add(_("User")); widths.Add(64);
    titles.Add(_("Prio")); widths.Add(48);
    titles.Add(_("Line")); widths.Add(48);
    titles.Add(_("Date")); widths.Add(56);
    titles.Add(_("File")); widths.Add(640);

    m_pListLog = new ToDoListView(titles, widths, m_Types);

    m_StandAlone = Manager::Get()->GetConfigManager(_T("todo_list"))->ReadBool(_T("stand_alone"), true);
    if (!m_StandAlone)
    {
        LogManager* msgMan = Manager::Get()->GetLogManager();
        m_ListPageIndex = msgMan->SetLog(m_pListLog);
        msgMan->Slot(m_ListPageIndex).title = _("To Do");

        CodeBlocksLogEvent evt(cbEVT_ADD_LOG_WINDOW, m_pListLog, msgMan->Slot(m_ListPageIndex).title, msgMan->Slot(m_ListPageIndex).icon);
        Manager::Get()->ProcessEvent(evt);
    }
    else
    {
        m_pListLog->CreateControl(Manager::Get()->GetAppWindow());
        m_pListLog->GetWindow()->SetSize(wxSize(352,94));
        m_pListLog->GetWindow()->SetInitialSize(wxSize(352,94));

        CodeBlocksDockEvent evt(cbEVT_ADD_DOCK_WINDOW);
        evt.name = _T("TodoListPanev2.0.0");
        evt.title = _("Todo list");
        evt.pWindow = m_pListLog->GetWindow();
        evt.dockSide = CodeBlocksDockEvent::dsFloating;
        evt.desiredSize.Set(352, 94);
        evt.floatingSize.Set(352, 94);
        evt.minimumSize.Set(352, 94);
        Manager::Get()->ProcessEvent(evt);
    }

    m_AutoRefresh = Manager::Get()->GetConfigManager(_T("todo_list"))->ReadBool(_T("auto_refresh"), true);
    LoadUsers();
    LoadTypes();

    // register event sink
    Manager::Get()->RegisterEventSink(cbEVT_APP_STARTUP_DONE, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnAppDoneStartup));
    Manager::Get()->RegisterEventSink(cbEVT_EDITOR_OPEN, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparseCurrent));
    Manager::Get()->RegisterEventSink(cbEVT_EDITOR_SAVE, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparseCurrent));
    Manager::Get()->RegisterEventSink(cbEVT_EDITOR_ACTIVATED, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparseCurrent));
    Manager::Get()->RegisterEventSink(cbEVT_EDITOR_CLOSE, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparseCurrent));
    Manager::Get()->RegisterEventSink(cbEVT_PROJECT_CLOSE, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparse));
    Manager::Get()->RegisterEventSink(cbEVT_PROJECT_ACTIVATE, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparse));
    Manager::Get()->RegisterEventSink(cbEVT_PROJECT_FILE_ADDED, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparse));
    Manager::Get()->RegisterEventSink(cbEVT_PROJECT_FILE_REMOVED, new cbEventFunctor<ToDoList, CodeBlocksEvent>(this, &ToDoList::OnReparse));
}
///<summary>Initialisation du client</summary>
///<param name="configPath">Chemin d'accès du fichier de configuration</param>
///<exception cref="MessageException">Echec d'initialisation</exception>
void ContainerApp::init(const std::string configPath)
{
    // récupérer configuration du serveur
    setConfig(configPath);
    
    // démarrer utilitaire de log
    LogManager* logTool = LogManager::getInstance(); // exception
    logTool->setFilePath(LOG_FILEPATH);
    logTool->setSeparator(_pConfig->logCsvSeparator);
}
Example #16
0
/*!
    \brief Destructor. Stop process if already running, destroy log windows.
*/
OpenOCDDriver::~OpenOCDDriver()
{
    if (m_bStarted)
        Stop();
    if (!(m_pLog == NULL)) {
        LogManager* msgMan = Manager::Get()->GetLogManager();
        CodeBlocksLogEvent evtAdd(cbEVT_REMOVE_LOG_WINDOW, m_pLog, msgMan->Slot(m_PageIndex).title, msgMan->Slot(m_PageIndex).icon);
		Manager::Get()->ProcessEvent(evtAdd);
    }
}
Example #17
0
void Network::close(void)//const String& anIp, const int aPort)
{
    LogManager *logger = Ogre::LogManager::getSingletonPtr();
    // Closing a socket.
    if (m_socket != NULL)
    {
        //closesocket(m_socket);
        m_socket = NULL;
    }
    logger->logMessage("Socket closed.\n");
}
Example #18
0
UI::EventReturn LogConfigScreen::OnToggleAll(UI::EventParams &e) {
    LogManager *logMan = LogManager::GetInstance();

    for (int i = 0; i < LogManager::GetNumChannels(); i++) {
        LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
        LogChannel *chan = logMan->GetLogChannel(type);
        chan->enable_ = !chan->enable_;
    }

    return UI::EVENT_DONE;
}
Example #19
0
void GLscene::showStatus()
{
    if (m_log->index()<0) return;

    LogManager<OpenHRP::SceneState> *lm 
        = (LogManager<OpenHRP::SceneState> *)m_log;
    OpenHRP::SceneState &sstate = lm->state();

    if (m_showingStatus){
        GLbody *glbody = NULL;
        OpenHRP::RobotState *rstate = NULL;
        for (unsigned int i=0; i<numBodies(); i++){
            if (body(i)->numJoints()){
                glbody = dynamic_cast<GLbody *>(body(i).get());
                rstate = &sstate.states[i];
                break;
            }
        }
#define HEIGHT_STEP 12
        int width = m_width - 410;
        int height = m_height-HEIGHT_STEP;
        char buf[256];
        for (unsigned int i=0; i<glbody->numJoints(); i++){
            hrp::Link *l = glbody->joint(i);
            if (l){
                int x = width;
                // joint ID
                sprintf(buf, "%2d",i);
                glRasterPos2f(x, height);
                drawString2(buf);
                white();
                x += 8*3;
                // joint name, current angle
                sprintf(buf, "%13s %8.3f", 
                        l->name.c_str(), 
                        rstate->q[i]*180/M_PI);
                glRasterPos2f(x, height);
                drawString2(buf);
                x += 8*(14+9);
                
                height -= HEIGHT_STEP;
            }
        }
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_BLEND);
        glColor4f(0.0,0.0,0.0, 0.5);
        if (m_showSlider){
            glRectf(width,SLIDER_AREA_HEIGHT,m_width,m_height);
        }else{
            glRectf(width,0,m_width,m_height);
        }
        glDisable(GL_BLEND);
    }
}
Example #20
0
//-------------------------------------------------------------------------------------
Network::Network(void)
{
    LogManager *logger = Ogre::LogManager::getSingletonPtr();
    // Initialize Winsock.
    WSADATA wsaData;
    int iResult = NO_ERROR;//WSAStartup( MAKEWORD(2,2), &wsaData );
    if ( iResult != NO_ERROR )
    {
        logger->logMessage("Error at WSAStartup()\n");
    }
}
Example #21
0
int
ConsoleStream::initialize (LoggingLevel level)
{
  Console* c = dynamic_cast<Console*>(out);
  Server* server = Server::getInstance ();
  LogManager* lm = server->getLogManager ();
  map<string, string> userColors = server->getConsoleColors ();
  map<LoggingLevel, string> levels = lm->getLoggingLevels ();
  string fg_color = userColors[levels[level] + "_fg"];
  string bg_color = userColors[levels[level] + "_bg"];
  return c->setColor (fg_color, bg_color);
}
Example #22
0
        void XMLLoadable::load(const string &fileName)
        {
            LogManager *logManager = LogManager::getInstance();

            TiXmlDocument *document = new TiXmlDocument(fileName);
            if(document->LoadFile()) {
                load(document->RootElement());
            } else {
                logManager->warning("Could not load xml document: %s.",
                        fileName.c_str());
            }
            delete document;
        }
Example #23
0
void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, 
		const char *file, int line, const char* fmt, ...) {
	if (!g_Config.bEnableLogging)
		return;

	va_list args;
	va_start(args, fmt);
	LogManager *instance = LogManager::GetInstance();
	if (instance) {
		instance->Log(level, type, file, line, fmt, args);
	}
	va_end(args);
}
Example #24
0
void LogLevelScreen::OnCompleted(DialogResult result) {
    if (result != DR_OK)
        return;
    int selected = listView_->GetSelected();
    LogManager *logMan = LogManager::GetInstance();

    for (int i = 0; i < LogManager::GetNumChannels(); ++i) {
        LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
        LogChannel *chan = logMan->GetLogChannel(type);
        if(chan->enable_ )
            chan->level_ = selected + 1;
    }
}
Example #25
0
void Network::send(void)//const String& aMessage)
{
    // Send and receive data.
    int bytesSent;

    char sendbuf[32] = "Client: Sending data.";


    /*bytesSent = send( m_socket, sendbuf, strlen(sendbuf), 0 );
    printf( "Bytes Sent: %ld\n", bytesSent );*/
    LogManager *logger = Ogre::LogManager::getSingletonPtr();
    logger->logMessage("Bytes Sent: ");
}
Example #26
0
void NativeInit(int argc, const char *argv[], const char *savegame_directory, const char *external_directory, const char *installID)
{
  std::string user_data_path = savegame_directory;

  // We want this to be FIRST.
  VFSRegister("", new DirectoryAssetReader("assets/"));
  VFSRegister("", new DirectoryAssetReader(user_data_path.c_str()));

  host = new NativeHost();

  logger = new AndroidLogger();

  LogManager::Init();
  LogManager *logman = LogManager::GetInstance();
  ILOG("Logman: %p", logman);

	if (argc > 1) 
	{
		boot_filename = argv[1];

		if (!File::Exists(boot_filename))
		{
			fprintf(stdout, "File not found: %s\n", boot_filename.c_str());
			exit(1);
		}
	}

	config_filename = user_data_path + "/config.ini";

	g_Config.Load(config_filename.c_str());

	if (g_Config.currentDirectory == "") {
#ifdef ANDROID
		g_Config.currentDirectory = external_directory;
#else
		g_Config.currentDirectory = getenv("HOME");
#endif
	}

  for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
  {
    LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
    logman->SetEnable(type, true);
    logman->SetLogLevel(type, LogTypes::LDEBUG);
#ifdef ANDROID
    logman->AddListener(type, logger);
#endif
  }
  logman->SetLogLevel(LogTypes::G3D, LogTypes::LERROR);
  INFO_LOG(BOOT, "Logger inited.");
}
Example #27
0
void retro_init(void) {
#if 0
	g_Config.Load("");
#endif

	g_Config.bEnableLogging = true;
	g_Config.bFrameSkipUnthrottle = false;
	g_Config.bMemStickInserted = PSP_MEMORYSTICK_STATE_INSERTED;
	g_Config.iGlobalVolume = VOLUME_MAX - 1;
	g_Config.bEnableSound = true;
	g_Config.bAudioResampler = false;
	g_Config.iCwCheatRefreshRate = 60;

	LogManager::Init();

	host = new LibretroHost;

	struct retro_log_callback log;
	if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log)) {
		printfLogger = new PrintfLogger(log);
		LogManager *logman = LogManager::GetInstance();
		logman->RemoveListener(logman->GetConsoleListener());
		logman->RemoveListener(logman->GetDebuggerListener());
		logman->ChangeFileLog(nullptr);
		logman->AddListener(printfLogger);
#if 1
		logman->SetAllLogLevels(LogTypes::LINFO);
#endif
	}
}
/** get project includes
  * \param root : the root node of the XML project file (<Project >
  **/
bool MSVC10Loader::GetProjectIncludes(const TiXmlElement* root)
{
    if (!root) return false;

    LogManager* pMsg = Manager::Get()->GetLogManager();
    if (!pMsg) return false;

    bool bResult = false;

    // parse all global parameters
    const TiXmlElement* prop = root->FirstChildElement("PropertyGroup");
    while (prop)
    {
        const char* attr = prop->Attribute("Condition");
        if (!attr) { prop = prop->NextSiblingElement(); continue; }

        wxString conf = cbC2U(attr);
        for (size_t i=0; i<m_pcNames.Count(); ++i)
        {
            wxString sName = m_pcNames.Item(i);
            wxString sConf = SubstituteConfigMacros(conf);
            if (sConf.IsSameAs(sName))
            {
                const TiXmlElement* cinc = prop->FirstChildElement("IncludePath");
                wxArrayString cdirs = GetDirectories(cinc);
                for (size_t j=0; j<cdirs.Count(); ++j)
                {
                    ProjectBuildTarget* bt = m_pc[sName].bt;
                    if (bt) bt->AddIncludeDir(cdirs.Item(j));
                }

                const TiXmlElement* linc = prop->FirstChildElement("LibraryPath");
                wxArrayString ldirs = GetDirectories(linc);
                for (size_t j=0; j<ldirs.Count(); ++j)
                {
                    ProjectBuildTarget* bt = m_pc[sName].bt;
                    if (bt) bt->AddLibDir(ldirs.Item(j));
                }
                bResult = true; // got something
            }
        }

        prop = prop->NextSiblingElement();
    }

    if (!bResult)
        pMsg->DebugLog(_("Failed to find any includes in the project...?!"));

    return bResult;
}
Example #29
0
int main(int argc, char **argv)
{
	string hostname;
	int port;
	parse_args(argc, argv, &hostname, &port);

        SBQLConfig config("Server");
	int error = config.init();
	if (error) {
	    cerr << "Config init failed with code " << error << "\n";
	    exit(1);
	}
	signal(SIGPIPE, SIG_IGN);
	ErrorConsole &con(ErrorConsole::get_instance(EC_SERVER));
	LogManager::checkForBackup();
	info_print(con, "Initializing Log manager and Store manager");
	LogManager *lm = new LogManager();
	lm->init();
	DBStoreManager *sm = new DBStoreManager();
	sm->init(lm);
	LockManager::init();
	TransactionManager::init(sm, lm);
	sm->setTManager(TransactionManager::getHandle());
	debug_print(con, "this " << "is " << "a test for " << 5);
	info_print(con, "Starting Store manager...");
	sm->start();
	info_print(con, "Starting Log manager...");
	lm->start(sm);
	QueryBuilder::startup();
	info_print(con, "Starting Index manager...");
	Indexes::IndexManager::init(LogManager::isCleanClosed());
	ClassGraph::ClassGraph::init(-1);
	Schemas::InterfaceMaps::Instance().init(); //must be called after ClassGraph::init()
	Schemas::OuterSchemas::Instance().init();

	::Server::Server serv(get_host_ip(hostname, con), htons(port), config);
	serv.main_loop();
	Indexes::IndexManager::shutdown(); //tutaj nie powinno juz byc zadnych aktywnych transakcji
	QueryBuilder::shutdown();
	sm->stop();
	unsigned idx;
	lm->shutdown(idx);//nie wiem czy tu to ma znaczenie,
	//ale z reguly najlepiej niszczyc w odwrotnej kolejnosci niz sie otwieralo.
	Schemas::OuterSchemas::Instance().deinit();
	Schemas::InterfaceMaps::Instance().deinit();
	ClassGraph::ClassGraph::shutdown();	
	delete TransactionManager::getHandle();
	return 0;
}
Example #30
0
bool MSVC10Loader::GetProjectIncludes(const TiXmlElement* root)
{
    if (!root) return false;

    LogManager* pMsg = Manager::Get()->GetLogManager();
    if (!pMsg) return false;

    bool bResult = false;

    // parse all global parameters
    const TiXmlElement* prop = root->FirstChildElement("PropertyGroup");
    for (; prop; prop=prop->NextSiblingElement("PropertyGroup"))
    {
        const char* attr = prop->Attribute("Condition");
        if (!attr) continue;

        wxString conf = cbC2U(attr);
        for (HashProjectsConfs::iterator it=m_pc.begin(); it!=m_pc.end(); ++it)
        {
            wxString sName = it->second.sName;
            wxString sConf = SubstituteConfigMacros(conf);
            if (sConf.IsSameAs(sName))
            {
                // $(VCInstallDir)include , $(VCInstallDir)atlmfc\include , $(WindowsSdkDir)include , $(FrameworkSDKDir)\include
                const TiXmlElement* cinc = prop->FirstChildElement("IncludePath");
                wxArrayString cdirs = GetArrayPaths(cinc, m_pc[sName]);
                for (size_t j=0; j<cdirs.Count(); ++j)
                {
                    ProjectBuildTarget* bt = m_pc[sName].bt;
                    if (bt) bt->AddIncludeDir(cdirs.Item(j));
                }
                // $(VCInstallDir)lib , $(VCInstallDir)atlmfc\lib , $(WindowsSdkDir)lib , $(FrameworkSDKDir)\lib
                const TiXmlElement* linc = prop->FirstChildElement("LibraryPath");
                wxArrayString ldirs = GetArrayPaths(linc, m_pc[sName]);
                for (size_t j=0; j<ldirs.Count(); ++j)
                {
                    ProjectBuildTarget* bt = m_pc[sName].bt;
                    if (bt) bt->AddLibDir(ldirs.Item(j));
                }
                bResult = true; // got something
            }
        }
    }

    if (!bResult)
        pMsg->DebugLog(_("Failed to find any includes in the project...?!"));

    return bResult;
}