예제 #1
0
CapturingTestLogger::CapturingTestLogger(int level) : BaseTestLogger()
{
  take_over();
  setPrinting(PrintingTestLogger::DEFAULT.isPrinting());
  setLoggingLevel(level);
  pthread_mutex_init(&_logger_lock, NULL);
};
HRESULT SystemProperties::loadSettings(const settings::SystemProperties &data)
{
    AutoCaller autoCaller(this);
    if (FAILED(autoCaller.rc())) return autoCaller.rc();

    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);

    HRESULT rc = S_OK;

    rc = setDefaultMachineFolder(data.strDefaultMachineFolder);
    if (FAILED(rc)) return rc;

    rc = setLoggingLevel(data.strLoggingLevel);
    if (FAILED(rc)) return rc;

    rc = setDefaultHardDiskFormat(data.strDefaultHardDiskFormat);
    if (FAILED(rc)) return rc;

    rc = setVRDEAuthLibrary(data.strVRDEAuthLibrary);
    if (FAILED(rc)) return rc;

    rc = setWebServiceAuthLibrary(data.strWebServiceAuthLibrary);
    if (FAILED(rc)) return rc;

    rc = setDefaultVRDEExtPack(data.strDefaultVRDEExtPack);
    if (FAILED(rc)) return rc;

    m->ulLogHistoryCount = data.ulLogHistoryCount;
    m->fExclusiveHwVirt  = data.fExclusiveHwVirt;

    rc = setAutostartDatabasePath(data.strAutostartDatabasePath);
    if (FAILED(rc)) return rc;

    {
        /* must ignore errors signalled here, because the guest additions
         * file may not exist, and in this case keep the empty string */
        ErrorInfoKeeper eik;
        (void)setDefaultAdditionsISO(data.strDefaultAdditionsISO);
    }

    rc = setDefaultFrontend(data.strDefaultFrontend);
    if (FAILED(rc)) return rc;

    return S_OK;
}
STDMETHODIMP SystemProperties::COMSETTER(LoggingLevel)(IN_BSTR aLoggingLevel)
{
    AutoCaller autoCaller(this);
    if (FAILED(autoCaller.rc())) return autoCaller.rc();

    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    HRESULT rc = setLoggingLevel(aLoggingLevel);
    alock.release();

    if (SUCCEEDED(rc))
    {
        AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);
        rc = mParent->saveSettings();
    }
    else
        LogRel(("Cannot set passed logging level=%ls, or the default one - Error=%Rhrc \n", aLoggingLevel, rc));

    return rc;
}
	void processConfiguration(char * key , char * value){

		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_LOGLEVEL) ){
			setLoggingLevel(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_DATADIR) ){
			setDataDirectory(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_CONTROLPORT) ){
			setServerControlPort(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_DATAPORT) ){
			setServerDataPort(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_ADDRESS) ){
			setServerAddress(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_LOGDIR) ){
			setLoggingDirectory(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_MAX_RETRIES) ){
			setMaxRetriesFindingDataPort( atoi(value) );
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_FTPS_STARTMODE) ){
			if(!strcmp("true" , value)){
				setOfflineStartMode(TRUE);
			}else{
				setOfflineStartMode(FALSE);
			}
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_KSS_ADDRESS) ){
			setKssAddress(value);
		}
		if( equalsStrings(key , FTPS_CONFIGURATION_KEY_KSS_PORT) ){
			setKssPort(value);
		}

		if( isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4, " Seteando " , key , "=" , value ));
	}
예제 #5
0
void PrintingTestLogger::setupFromEnvironment()
{
  // Set logging to the specified level if specified in the environment.
  // NOISY=T:5 sets the level to 5.
  char* val = getenv("NOISY");
  bool is_noisy = ((val != NULL) &&
                   (strchr("TtYy", val[0]) != NULL));
  int level = DEFAULT_LOGGING_LEVEL;

  if (val != NULL)
  {
    val = strchr(val, ':');

    if (val != NULL)
    {
      level = strtol(val + 1, NULL, 10);
    }
  }

  setPrinting(is_noisy);
  setLoggingLevel(level);
}
/**
 * Initializes the system information object.
 *
 * @returns COM result indicator
 */
HRESULT SystemProperties::init(VirtualBox *aParent)
{
    LogFlowThisFunc(("aParent=%p\n", aParent));

    ComAssertRet(aParent, E_FAIL);

    /* Enclose the state transition NotReady->InInit->Ready */
    AutoInitSpan autoInitSpan(this);
    AssertReturn(autoInitSpan.isOk(), E_FAIL);

    unconst(mParent) = aParent;

    setDefaultMachineFolder(Utf8Str::Empty);
    setLoggingLevel(Utf8Str::Empty);
    setDefaultHardDiskFormat(Utf8Str::Empty);

    setVRDEAuthLibrary(Utf8Str::Empty);
    setDefaultVRDEExtPack(Utf8Str::Empty);

    m->ulLogHistoryCount = 3;


    /* On Windows and OS X, HW virtualization use isn't exclusive by
     * default so that VT-x or AMD-V can be shared with other
     * hypervisors without requiring user intervention.
     * NB: See also SystemProperties constructor in settings.h
     */
#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    m->fExclusiveHwVirt = false;
#else
    m->fExclusiveHwVirt = true;
#endif

    HRESULT rc = S_OK;

    /* Fetch info of all available hd backends. */

    /// @todo NEWMEDIA VDBackendInfo needs to be improved to let us enumerate
    /// any number of backends

    VDBACKENDINFO aVDInfo[100];
    unsigned cEntries;
    int vrc = VDBackendInfo(RT_ELEMENTS(aVDInfo), aVDInfo, &cEntries);
    AssertRC(vrc);
    if (RT_SUCCESS(vrc))
    {
        for (unsigned i = 0; i < cEntries; ++ i)
        {
            ComObjPtr<MediumFormat> hdf;
            rc = hdf.createObject();
            if (FAILED(rc)) break;

            rc = hdf->init(&aVDInfo[i]);
            if (FAILED(rc)) break;

            m_llMediumFormats.push_back(hdf);
        }
    }

    /* Confirm a successful initialization */
    if (SUCCEEDED(rc))
        autoInitSpan.setSucceeded();

    return rc;
}
	void setUpConfiguration(){

		char * dataDir = getConfigurationStrValue( getGlobalHeap() , 
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_DATADIR);
				
		char * ctrlPort = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_CONTROLPORT);

		char * dataPort = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_DATAPORT);
	
		char * serverAddr = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_ADDRESS);
		
		char * logDir = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_LOGDIR);
		
		char * logLevel = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_LOGLEVEL);

		char * startMode = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_FTPS_STARTMODE);

		char * kssAddress = getConfigurationStrValue( getGlobalHeap() , 
			CONFIGURATION_FILE , KSS_SECTION , FTPS_CONFIGURATION_KEY_KSS_ADDRESS);

		char * kssPort = getConfigurationStrValue( getGlobalHeap() , 
			CONFIGURATION_FILE , KSS_SECTION , FTPS_CONFIGURATION_KEY_KSS_PORT);

		char * maxRetries = getConfigurationStrValue( getGlobalHeap() ,
			CONFIGURATION_FILE , FTPS_SECTION , FTPS_CONFIGURATION_KEY_MAX_RETRIES);

		info("Cargando la configuracion");
		
		setDataDirectory(dataDir);
		setServerControlPort(ctrlPort);
		setServerDataPort(dataPort);
		setServerAddress(serverAddr);
		setLoggingDirectory(logDir);
		setLoggingLevel(logLevel);
		setMaxRetriesFindingDataPort(atoi(maxRetries));
		setKssAddress(kssAddress);
		setKssPort(kssPort);

		if(!strcmp("true" , startMode)){
			setOfflineStartMode(TRUE);
		}else{
			setOfflineStartMode(FALSE);
		}

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_DATADIR , "=" , dataDir));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_CONTROLPORT , "=" , ctrlPort));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_DATAPORT , "=" , dataPort));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_ADDRESS , "=" , serverAddr));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_LOGDIR , "=" , logDir));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_LOGLEVEL , "=" , logLevel));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_FTPS_STARTMODE , "=" , startMode));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_MAX_RETRIES , "=" , maxRetries));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_KSS_ADDRESS , "=" , kssAddress));

		if(isDebugEnabled()) 
			debug(concat(getGlobalHeap() , 4 , "Seteando " , 
				FTPS_CONFIGURATION_KEY_KSS_ADDRESS , "=" , kssPort));			
		
		
	}
/*!   Verbose log checkbox menu item
 *
 */
void GdbServerWindow::OnVerboseLog(wxCommandEvent& event) {
   setLoggingLevel(M_BORINGINFO);
}
/*!   Verbose log checkbox menu item
 *
 */
void GdbServerWindow::OnModerateLog(wxCommandEvent& event) {
   setLoggingLevel(M_INFO);
}
/*!   Verbose log checkbox menu item
 *
 */
void GdbServerWindow::OnDisableLog(wxCommandEvent& event) {
   setLoggingLevel(M_ERROR);
}