bool GuidingLog::EnableLogging(bool enable) { if (enable) return EnableLogging(); DisableLogging(); return false; }
/* static */ void DecoderDoctorLogger::Init() { MOZ_ASSERT(static_cast<LogState>(sLogState) == scDisabled); if (MOZ_LOG_TEST(sDecoderDoctorLoggerLog, LogLevel::Error) || MOZ_LOG_TEST(sDecoderDoctorLoggerEndLog, LogLevel::Error)) { EnableLogging(); } }
VMemLogger::VMemLogger() { m_nTotalAllocations = 0; m_nTotalReleases = 0; m_nTotalAllocatedMem = 0; m_nTotalReleasedMem = 0; m_nCurrentUsedMem = 0; m_bLogginEnabled = false; EnableLogging(); }
void GUI::SetMeta(){ // Disable logging EnableLogging(false); // Enable tooltips ConfigTooltips(1000, 5000, 0, 200); // Load configuration settings Config::Load(); // Set language to display SetLanguage(wxLANGUAGE_ENGLISH); wxString *language = Config::Language(); for(unsigned char cur_lang = wxLANGUAGE_ABKHAZIAN; cur_lang <= wxLANGUAGE_ZULU; cur_lang++) if(*language == wxLocale::GetLanguageName(cur_lang)){ SetLanguage(static_cast<wxLanguage>(cur_lang)); break; } }
ConfigResult Logger::OnSourceModConfigChanged(const char *key, const char *value, ConfigSource source, char *error, size_t maxlength) { if (strcasecmp(key, "Logging") == 0) { bool state; if (strcasecmp(value, "on") == 0) { state = true; } else if (strcasecmp(value, "off") == 0) { state = false; } else { ke::SafeStrcpy(error, maxlength, "Invalid value: must be \"on\" or \"off\""); return ConfigResult_Reject; } if (source == ConfigSource_Console) { state ? EnableLogging() : DisableLogging(); } else { m_Active = state; } return ConfigResult_Accept; } else if (strcasecmp(key, "LogMode") == 0) { if (strcasecmp(value, "daily") == 0) { m_Mode = LoggingMode_Daily; } else if (strcasecmp(value, "map") == 0) { m_Mode = LoggingMode_PerMap; } else if (strcasecmp(value, "game") == 0) { m_Mode = LoggingMode_Game; } else { ke::SafeStrcpy(error, maxlength, "Invalid value: must be [daily|map|game]"); return ConfigResult_Reject; } return ConfigResult_Accept; } return ConfigResult_Ignore; }
void CWsTop::LogCommand(RWsSession::TLoggingCommand aCommand) { switch(aCommand) { case RWsSession::ELoggingEnable: EnableLogging(); break; case RWsSession::ELoggingDisable: DisableLogging(); break; case RWsSession::ELoggingStatusDump: StateDump(); break; case RWsSession::ELoggingHeapDump: HeapDump(); break; } }
bool GuidingLog::ChangeDirLog(const wxString& newdir) { bool bEnabled = IsEnabled(); bool bOk = true; if (bEnabled) { Close(); } if (!SetLogDir(newdir)) { wxMessageBox(wxString::Format("invalid folder name %s, log folder unchanged", newdir)); bOk = false; } if (bEnabled) // if SetLogDir failed, no harm no foul, stay with original. Otherwise { EnableLogging(); // start fresh... } return bOk; }
void CWsTop::InitStaticsL() { iShuttingDown=EFalse; // By default shell should be started. TBool startShell = ETrue; iCurrentFocusScreen = 0; // The windows server has been invoked. // This may have been from the system starter (via a // start up rss file) // This block looks for a "-NoShell" argument in the invocation. // The existence of the argument means that shell does not need to be // invoked from here because the new system starter // is in charge, and it will do it if required. _LIT(KNoShell,"-NOSHELL"); TInt argLen = User::CommandLineLength(); if(argLen) { HBufC* arg = HBufC::NewLC(argLen); TPtr argPtr = arg->Des(); User::CommandLine(argPtr); argPtr.UpperCase(); if(KErrNotFound != argPtr.Find(KNoShell)) { // Don't start the shell. It will be started if required by // the system starter. startShell = EFalse; } CleanupStack::PopAndDestroy(arg); } TheActiveScheduler=new(ELeave) CWsActiveScheduler; CActiveScheduler::Install(TheActiveScheduler); // WsIniFile is already created (before E32Main's Loop) _LIT(KWSERVIniFileVarLogEnable,"LOGENABLE"); TInt loggingLevel; if (WsIniFile->FindVar(KWSERVIniFileVarLogEnable,loggingLevel)) { EnableLogging(EDoNotReloadWsIni); if (wsDebugLog) { wsDebugLog->SetLoggingLevel(loggingLevel); } } _LIT(KWSERVIniFileVarFadeEnable,"FADEDISABLE"); iFadeEnabled = !WsIniFile->FindVar(KWSERVIniFileVarFadeEnable); _LIT(KWSERVIniFileVarFinishEveryFlush,"FINISHEVERYFLUSH"); iFinishEveryFlush = WsIniFile->FindVar(KWSERVIniFileVarFinishEveryFlush); _LIT(KWSERVIniFileVarSwitchOffEvent,"IGNORESWITCHOFFEVENT"); iIgnoreSwitchOffEvent = WsIniFile->FindVar(KWSERVIniFileVarSwitchOffEvent); iPluginManager = CWsPluginManager::NewL(); // need to be constructed before iServer! iServer=CWindowServer::NewL(); CClick::InitStaticsL(); RProcess wservProc; if (!wservProc.DefaultDataPaged()) { iServer->SetPinClientDescriptors(ETrue); } User::LeaveIfError(FbsStartup()); User::LeaveIfError(RFbsSession::Connect()); User::LeaveIfError(iTimer.CreateLocal()); TWindowServerEvent::InitStaticsL(); CWsClient::InitStaticsL(); //------------------------------------------- User::LeaveIfError( HAL::Get( HAL::EDisplayNumberOfScreens, iNumberOfScreens ) ) ; // Check that the INI file matches the HAL WS_ASSERT_ALWAYS(WsIniFile->NumberOfScreens()<=iNumberOfScreens, EWsPanicScreenInformationError); iScreens = new (ELeave) CArrayPtrFlat<CScreen>( iNumberOfScreens ) ; // // now construct screens for as long as there is information TInt ii ; for ( ii = 0 ; ii < iNumberOfScreens ; ++ii ) { InitScreenL( ii ) ; } //--------------------------------------------- iCurrentFocusScreen = (*iScreens)[0] ; iServer->StartL(); CWsFontCache::CreateInstanceL(); CWsGc::InitStaticsL(); CPlaybackGc::InitStaticsL(); CWsSpriteBase::InitStaticsL(); CEventQueue::InitStaticsL(); // CWsAnimDll::InitStaticsL(); // TInt bootMode=0; _LIT(KWSERVIniFileVarReboot,"REBOOT"); WsIniFile->FindVar(KWSERVIniFileVarReboot,bootMode); if (bootMode>=0 && bootMode<=2) iShellBootMode=bootMode; // CWsBackedUpWindow::StaticInitL(); CWsRedrawMsgWindow::StaticInitL(); // TWsPointer::InitStaticsL(); iShellStarter=new (ELeave) CShellStarter; iShellStarter->ConstructL(); _LIT(KPreProcess,"REMOVEFADINGONFOCUSGAIN"); CWsWindowGroup::SetFocusGainPreprocessing(WsIniFile->FindVar(KPreProcess)); _LIT(KAbsFade,"ABSOLUTEFADING"); CWsClientWindow::SetAbsoluteFading(WsIniFile->FindVar(KAbsFade)); //Set the focus policy _LIT(KFocusPolicy,"MULTIFOCUSPOLICY"); if(WsIniFile->FindVar(KFocusPolicy)) { iMultiFocusPolicy = ETrue; } RProcess::Rendezvous(KErrNone); // Start the shell from here unless the 'NoShell' option has been // received indicating that the system starter will start the shell directly. if(startShell) { StartShell(); } UserSvr::WsRegisterSwitchOnScreenHandling(ETrue); iRenderOrientationTracker = CWsRenderOrienationTracker::NewL(); }
// To enable/disable logging HRESULT CFrameProcessor_J1939::FPJ1_EnableLogging(BOOL bEnable) { return EnableLogging(bEnable, J1939); }
// To enable/disable logging HRESULT CFrameProcessor_CAN::FPC_EnableLogging(BOOL bEnable) { return EnableLogging(bEnable); }
void PlayBatchMacro(LPLIST lpQueueList) /***********************************************************************/ { LPQUEUEITEM lpQueueItem = NULL; LPMACROITEM lpMacroItem; FNAME szFileName; LIST TempList; BOOL fError = TRUE; fPCDNotice = FALSE; while (TRUE) { if (lpQueueItem) lpQueueItem = (LPQUEUEITEM)ListGetNext(lpQueueItem); else lpQueueItem = (LPQUEUEITEM)ListGetHead(lpQueueList); if (!lpQueueItem) { fError = FALSE; break; } ListInit(&lpQueueItem->PacketList); // create a command list for the load command if (!CreateLoadFileParms(0, lpQueueItem->szFileName, TRUE, &lpQueueItem->cmsInfo, &lpQueueItem->PhotoCDResOverride, &lpQueueItem->parms)) continue; lpMacroItem = NULL; while (TRUE) { if (lpMacroItem) lpMacroItem = (LPMACROITEM)ListGetNext(lpMacroItem); else lpMacroItem = (LPMACROITEM)ListGetHead(&lpQueueItem->MacroList); if (!lpMacroItem) break; if ( !LookupExtFile( lpMacroItem->szMacro, szFileName, IDN_MACRO ) ) continue; // read in the entire macro file for faster processing if (!ReadMacro(szFileName, &TempList)) continue; if (MacroAnyLoadCommands(&TempList)) { Message(IDS_BADBATCHMACRO); DestroyPacketList(&TempList); continue; } ListAddTail(&lpQueueItem->PacketList, ListGetHead(&TempList)); } if (!SetupMacro(lpQueueItem)) break; } if (!fError) { if (EnableLogging(TRUE)) { lpQueueItem = NULL; while (!fError) { if (lpQueueItem) lpQueueItem = (LPQUEUEITEM)ListGetNext(lpQueueItem); else lpQueueItem = (LPQUEUEITEM)ListGetHead(lpQueueList); if (!lpQueueItem) break; if (!PlayMacro(NULL, NULL, 1, NO, &lpQueueItem->PacketList, NULL, lpQueueItem->PhotoCDResOverride)) break; } EnableLogging(FALSE); } } lpQueueItem = NULL; while (TRUE) { if (lpQueueItem) lpQueueItem = (LPQUEUEITEM)ListGetNext(lpQueueItem); else lpQueueItem = (LPQUEUEITEM)ListGetHead(lpQueueList); if (!lpQueueItem) break; DestroyPacketList(&lpQueueItem->PacketList); DestroyPtrList(&lpQueueItem->MacroList); } DestroyPtrList(lpQueueList); }
// To enable/disable logging //[RS_LIN_06_03] and [RS_LIN_06_04] HRESULT CFrameProcessor_LIN::FPL_EnableLogging(BOOL bEnable) { return EnableLogging(bEnable, LIN); }
/** * @brief Destructor. */ CLogFile::~CLogFile() { EnableLogging(FALSE); CloseHandle(m_hLogMutex); }