bool GuidingLog::EnableLogging(bool enable) { if (enable) return EnableLogging(); DisableLogging(); return false; }
void CWsTop::DeleteStaticsL() { iShuttingDown=ETrue; delete iRenderOrientationTracker; CClick::DeleteStatics(); TWsPointer::Stop(); CWsClient::DeleteStatics(); // delete iShellStarter; iServer->DestroySessionsForShutdown(); CWsBackedUpWindow::StaticDestroy(); delete iShell; DisableLogging(); CEventQueue::DeleteStaticsL(); CWsSpriteBase::DeleteStatics(); CWsGc::DeleteStatics(); CPlaybackGc::DeleteStatics(); CWsAnimDll::DeleteStatics(); CWsFontCache::DestroyInstance(); iScreens->ResetAndDestroy(); delete iScreens; delete iServer; TWindowServerEvent::DeleteStatics(); // Free singletons on WServ heap created by libraries. Must be called // BEFORE iPluginManager is deleted otherwise the library code could have // been unloaded. DeleteSingleton(KOpenWfcImplCleanupKey); DeleteSingleton(KOpenWfcInteropCleanupKey); eglReleaseThread(); if (!iDoHeapCheckAndRestart) { RFbsSession::GetSession()->SendCommand(RFbsSession_SendCommand_ShutDownMessage); //This line is just being tidy, never really does anything useful. } RFbsSession::Disconnect(); iDebugLib.Close(); iTimer.Close(); TWsPointer::DeleteStatics(); delete TheActiveScheduler; // iPluginManager is not created in InitStaticsL because plugins need to be loaded // before E32Main's loop for EcomSession allocations issues delete iPluginManager; }
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; } }
void CWsTop::EnableLogging(TReloadWsIni aSetting) { TInt errorLoc=0; if (wsDebugLog) { if (wsDebugLogLevel==CDebugLogBase::ELogEverything) { wsDebugLogLevel=CDebugLogBase::ELogImportant; wsDebugLog->SetLoggingLevel(wsDebugLogLevel); return; } DisableLogging(); } if(aSetting == EDoReloadWsIni) { CIniFile* temp = NULL; TRAPD(err, temp = CIniFile::NewL()); if(err == KErrNone) { //loading successful, replace the previous one delete WsIniFile; WsIniFile = temp; } } TPtrC dlog; _LIT(KWSERVDebugLogFileName,"DLOG"); TBuf<KMaxFileName> fname(KWSERVDebugLogFileName); _LIT(KWSERVIniFileVarLog,"LOG"); if (WsIniFile->FindVar(KWSERVIniFileVarLog,dlog) && dlog.Length()==2) { fname.Append(dlog); TInt err=iDebugLib.Load(fname); if (err==KErrNone) { TUidType uid=iDebugLib.Type(); if (uid[1]!=KWservLoggingDllUid) { err=KErrNotSupported; errorLoc=2; } else { TPtrC params; _LIT(KWSERVIniFileVarLogP,"LOGP"); if (!WsIniFile->FindVar(KWSERVIniFileVarLogP,params)) params.Set(NULL,0); CreateDebugLog func=(CreateDebugLog)iDebugLib.Lookup(1); if (func!=NULL) { TRAP(err,wsDebugLog=(*func)(iIsFirstLog, params)); if (err==KErrNone) { iIsFirstLog=EFalse; wsDebugLogLevel=CDebugLogBase::ELogEverything; } else errorLoc=4; } else errorLoc=3; } } else errorLoc=1; if (iCurrentFocusScreen) { TWindowServerEvent::ProcessErrorMessages(TWsErrorMessage::ELogging,(errorLoc<<8)-err); } } }