示例#1
0
文件: CApp.cpp 项目: rosedu/synergy
void
CApp::initApp(int argc, const char** argv)
{
    LOG ((CLOG_INFO "CApp::initApp call"));
	// parse command line
	parseArgs(argc, argv);

	// setup file logging after parsing args
	setupFileLogging();

	// load configuration
	loadConfig();

	if (!argsBase().m_disableTray) {

		// create a log buffer so we can show the latest message
		// as a tray icon tooltip
		CBufferedLogOutputter* logBuffer = new CBufferedLogOutputter(1000);
		CLOG->insert(logBuffer, true);

		// make the task bar receiver.  the user can control this app
		// through the task bar.
		m_taskBarReceiver = m_createTaskBarReceiver(logBuffer);
	}
}
示例#2
0
void 
App::initApp(int argc, const char** argv)
{
    // parse command line
    parseArgs(argc, argv);

#if WINAPI_XWINDOWS
    // for use on linux, tell the core process what user id it should run as.
    // this is a simple way to allow the core process to talk to X. this avoids
    // the "WARNING: primary screen unavailable: unable to open screen" error.
    // a better way would be to use xauth cookie and dbus to get access to X.
    if (argsBase().m_runAsUid >= 0) {
        if (setuid(argsBase().m_runAsUid) == 0) {
            LOG((CLOG_DEBUG "process uid was set to: %d", argsBase().m_runAsUid));
        }
        else {
            LOG((CLOG_WARN "failed to set process uid to: %d", argsBase().m_runAsUid));
        }
    }
#endif
    
    ARCH->setProfileDirectory(argsBase().m_profileDirectory);
    ARCH->setPluginDirectory(argsBase().m_pluginDirectory);

    // set log filter
    if (!CLOG->setFilter(argsBase().m_logFilter)) {
        LOG((CLOG_PRINT "%s: unrecognized log level `%s'" BYE,
            argsBase().m_pname, argsBase().m_logFilter, argsBase().m_pname));
        m_bye(kExitArgs);
    }
    loggingFilterWarning();
    
    if (argsBase().m_enableDragDrop) {
        LOG((CLOG_INFO "drag and drop enabled"));
    }

    // setup file logging after parsing args
    setupFileLogging();

    // load configuration
    loadConfig();
}
示例#3
0
void 
App::initApp(int argc, const char** argv)
{
	// parse command line
	parseArgs(argc, argv);
	
	ARCH->setProfileDirectory(argsBase().m_profileDirectory);
	ARCH->setPluginDirectory(argsBase().m_pluginDirectory);

	// set log filter
	if (!CLOG->setFilter(argsBase().m_logFilter)) {
		LOG((CLOG_PRINT "%s: unrecognized log level `%s'" BYE,
			argsBase().m_pname, argsBase().m_logFilter, argsBase().m_pname));
		m_bye(kExitArgs);
	}
	loggingFilterWarning();
	
	if (argsBase().m_enableDragDrop) {
		LOG((CLOG_INFO "drag and drop enabled"));
	}

	// setup file logging after parsing args
	setupFileLogging();

	// load configuration
	loadConfig();

	if (!argsBase().m_disableTray) {

		// create a log buffer so we can show the latest message
		// as a tray icon tooltip
		BufferedLogOutputter* logBuffer = new BufferedLogOutputter(1000);
		CLOG->insert(logBuffer, true);

		// make the task bar receiver.  the user can control this app
		// through the task bar.
		m_taskBarReceiver = m_createTaskBarReceiver(logBuffer, m_events);
	}
}