Kaydet (Commit) 45413e32 authored tarafından Rob Snelders's avatar Rob Snelders Kaydeden (comit) Caolán McNamara

Removal VERBOSE

üst 8ae3e12f
...@@ -42,18 +42,15 @@ using namespace ::com::sun::star; ...@@ -42,18 +42,15 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework; using namespace ::com::sun::star::drawing::framework;
#undef VERBOSE
//#define VERBOSE 1
namespace { namespace {
#ifdef VERBOSE #if OSL_DEBUG_LEVEL > 0
void TraceRequest (const Reference<XConfigurationChangeRequest>& rxRequest) void TraceRequest (const Reference<XConfigurationChangeRequest>& rxRequest)
{ {
Reference<container::XNamed> xNamed (rxRequest, UNO_QUERY); Reference<container::XNamed> xNamed (rxRequest, UNO_QUERY);
if (xNamed.is()) if (xNamed.is())
OSL_TRACE(" %s\n", SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " <<
::rtl::OUStringToOString(xNamed->getName(), RTL_TEXTENCODING_UTF8).getStr()); ::rtl::OUStringToOString(xNamed->getName(), RTL_TEXTENCODING_UTF8).getStr());
} }
...@@ -105,14 +102,14 @@ void ChangeRequestQueueProcessor::AddRequest ( ...@@ -105,14 +102,14 @@ void ChangeRequestQueueProcessor::AddRequest (
{ {
::osl::MutexGuard aGuard (maMutex); ::osl::MutexGuard aGuard (maMutex);
#ifdef VERBOSE #if OSL_DEBUG_LEVEL >= 2
if (maQueue.empty()) if (maQueue.empty())
{ {
OSL_TRACE("Adding requests to empty queue"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Adding requests to empty queue");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
mxConfiguration, "current configuration of queue processor"); mxConfiguration, "current configuration of queue processor");
} }
OSL_TRACE("Adding request"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Adding request");
TraceRequest(rxRequest); TraceRequest(rxRequest);
#endif #endif
...@@ -131,9 +128,7 @@ void ChangeRequestQueueProcessor::StartProcessing (void) ...@@ -131,9 +128,7 @@ void ChangeRequestQueueProcessor::StartProcessing (void)
&& mxConfiguration.is() && mxConfiguration.is()
&& ! maQueue.empty()) && ! maQueue.empty())
{ {
#ifdef VERBOSE SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ChangeRequestQueueProcessor scheduling processing");
OSL_TRACE("ChangeRequestQueueProcessor scheduling processing");
#endif
mnUserEventId = Application::PostUserEvent( mnUserEventId = Application::PostUserEvent(
LINK(this,ChangeRequestQueueProcessor,ProcessEvent)); LINK(this,ChangeRequestQueueProcessor,ProcessEvent));
} }
...@@ -168,9 +163,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void) ...@@ -168,9 +163,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void)
{ {
::osl::MutexGuard aGuard (maMutex); ::osl::MutexGuard aGuard (maMutex);
#ifdef VERBOSE SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ProcessOneEvent");
OSL_TRACE("ProcessOneEvent");
#endif
if (mxConfiguration.is() if (mxConfiguration.is()
&& ! maQueue.empty()) && ! maQueue.empty())
...@@ -182,7 +175,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void) ...@@ -182,7 +175,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void)
// Execute the change request. // Execute the change request.
if (xRequest.is()) if (xRequest.is())
{ {
#ifdef VERBOSE #if OSL_DEBUG_LEVEL >= 2
TraceRequest(xRequest); TraceRequest(xRequest);
#endif #endif
xRequest->execute(mxConfiguration); xRequest->execute(mxConfiguration);
...@@ -190,14 +183,12 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void) ...@@ -190,14 +183,12 @@ void ChangeRequestQueueProcessor::ProcessOneEvent (void)
if (maQueue.empty()) if (maQueue.empty())
{ {
#ifdef VERBOSE SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": All requests are processed");
OSL_TRACE("All requests are processed");
#endif
// The queue is empty so tell the ConfigurationManager to update // The queue is empty so tell the ConfigurationManager to update
// its state. // its state.
if (mpConfigurationUpdater.get() != NULL) if (mpConfigurationUpdater.get() != NULL)
{ {
#ifdef VERBOSE #if OSL_DEBUG_LEVEL >= 2
ConfigurationTracer::TraceConfiguration ( ConfigurationTracer::TraceConfiguration (
mxConfiguration, "updating to configuration"); mxConfiguration, "updating to configuration");
#endif #endif
......
...@@ -40,8 +40,6 @@ using namespace ::com::sun::star::drawing::framework; ...@@ -40,8 +40,6 @@ using namespace ::com::sun::star::drawing::framework;
using ::sd::framework::FrameworkHelper; using ::sd::framework::FrameworkHelper;
using ::rtl::OUString; using ::rtl::OUString;
#undef VERBOSE
namespace { namespace {
/** Use the XResourceId::compareTo() method to implement a compare operator /** Use the XResourceId::compareTo() method to implement a compare operator
for STL containers. for STL containers.
...@@ -163,11 +161,9 @@ void SAL_CALL Configuration::addResource (const Reference<XResourceId>& rxResour ...@@ -163,11 +161,9 @@ void SAL_CALL Configuration::addResource (const Reference<XResourceId>& rxResour
if (mpResourceContainer->find(rxResourceId) == mpResourceContainer->end()) if (mpResourceContainer->find(rxResourceId) == mpResourceContainer->end())
{ {
#ifdef VERBOSE SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Configuration::addResource() " <<
OSL_TRACE("Configuration::addResource() %s", OUStringToOString(
OUStringToOString( FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
mpResourceContainer->insert(rxResourceId); mpResourceContainer->insert(rxResourceId);
PostEvent(rxResourceId, true); PostEvent(rxResourceId, true);
} }
...@@ -187,11 +183,9 @@ void SAL_CALL Configuration::removeResource (const Reference<XResourceId>& rxRes ...@@ -187,11 +183,9 @@ void SAL_CALL Configuration::removeResource (const Reference<XResourceId>& rxRes
ResourceContainer::iterator iResource (mpResourceContainer->find(rxResourceId)); ResourceContainer::iterator iResource (mpResourceContainer->find(rxResourceId));
if (iResource != mpResourceContainer->end()) if (iResource != mpResourceContainer->end())
{ {
#ifdef VERBOSE SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Configuration::removeResource() " <<
OSL_TRACE("Configuration::removeResource() %s", OUStringToOString(
OUStringToOString( FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
PostEvent(rxResourceId,false); PostEvent(rxResourceId,false);
mpResourceContainer->erase(iResource); mpResourceContainer->erase(iResource);
} }
......
...@@ -36,10 +36,6 @@ using namespace ::com::sun::star::uno; ...@@ -36,10 +36,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework; using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString; using ::rtl::OUString;
#undef VERBOSE
//#define VERBOSE 2
namespace sd { namespace framework { namespace sd { namespace framework {
ConfigurationClassifier::ConfigurationClassifier ( ConfigurationClassifier::ConfigurationClassifier (
...@@ -110,13 +106,9 @@ void ConfigurationClassifier::PartitionResources ( ...@@ -110,13 +106,9 @@ void ConfigurationClassifier::PartitionResources (
aC2minusC1, aC2minusC1,
aC1andC2); aC1andC2);
#if defined VERBOSE && VERBOSE >= 2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying resource ids to C1-C2");
OSL_TRACE("copying resource ids to C1-C2\r");
#endif
CopyResources(aC1minusC2, mxConfiguration1, maC1minusC2); CopyResources(aC1minusC2, mxConfiguration1, maC1minusC2);
#if defined VERBOSE && VERBOSE >= 2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying resource ids to C2-C1");
OSL_TRACE("copying resource ids to C2-C1\r");
#endif
CopyResources(aC2minusC1, mxConfiguration2, maC2minusC1); CopyResources(aC2minusC1, mxConfiguration2, maC2minusC1);
// Process the unique resources that belong to both configurations. // Process the unique resources that belong to both configurations.
...@@ -199,21 +191,17 @@ void ConfigurationClassifier::CopyResources ( ...@@ -199,21 +191,17 @@ void ConfigurationClassifier::CopyResources (
rTarget.reserve(rTarget.size() + 1 + nL); rTarget.reserve(rTarget.size() + 1 + nL);
rTarget.push_back(*iResource); rTarget.push_back(*iResource);
#if defined VERBOSE && VERBOSE >= 2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying " <<
OSL_TRACE(" copying %s\r",
OUStringToOString(FrameworkHelper::ResourceIdToString(*iResource), OUStringToOString(FrameworkHelper::ResourceIdToString(*iResource),
RTL_TEXTENCODING_UTF8).getStr()); RTL_TEXTENCODING_UTF8).getStr());
#endif
const Reference<XResourceId>* aA = aBoundResources.getConstArray(); const Reference<XResourceId>* aA = aBoundResources.getConstArray();
for (sal_Int32 i=0; i<nL; ++i) for (sal_Int32 i=0; i<nL; ++i)
{ {
rTarget.push_back(aA[i]); rTarget.push_back(aA[i]);
#if defined VERBOSE && VERBOSE >= 2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying " <<
OSL_TRACE(" copying %s\r",
OUStringToOString(FrameworkHelper::ResourceIdToString(aA[i]), OUStringToOString(FrameworkHelper::ResourceIdToString(aA[i]),
RTL_TEXTENCODING_UTF8).getStr()); RTL_TEXTENCODING_UTF8).getStr());
#endif
} }
} }
} }
...@@ -224,12 +212,12 @@ void ConfigurationClassifier::TraceResourceIdVector ( ...@@ -224,12 +212,12 @@ void ConfigurationClassifier::TraceResourceIdVector (
const ResourceIdVector& rResources) const const ResourceIdVector& rResources) const
{ {
OSL_TRACE(pMessage); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " << pMessage);
ResourceIdVector::const_iterator iResource; ResourceIdVector::const_iterator iResource;
for (iResource=rResources.begin(); iResource!=rResources.end(); ++iResource) for (iResource=rResources.begin(); iResource!=rResources.end(); ++iResource)
{ {
OUString sResource (FrameworkHelper::ResourceIdToString(*iResource)); OUString sResource (FrameworkHelper::ResourceIdToString(*iResource));
OSL_TRACE(" %s\r", SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " <<
OUStringToOString(sResource, RTL_TEXTENCODING_UTF8).getStr()); OUStringToOString(sResource, RTL_TEXTENCODING_UTF8).getStr());
} }
} }
......
...@@ -52,10 +52,6 @@ using namespace ::com::sun::star::drawing::framework; ...@@ -52,10 +52,6 @@ using namespace ::com::sun::star::drawing::framework;
using rtl::OUString; using rtl::OUString;
using ::sd::framework::FrameworkHelper; using ::sd::framework::FrameworkHelper;
#undef VERBOSE
//#define VERBOSE 3
namespace sd { namespace framework { namespace sd { namespace framework {
Reference<XInterface> SAL_CALL ConfigurationController_createInstance ( Reference<XInterface> SAL_CALL ConfigurationController_createInstance (
...@@ -180,18 +176,14 @@ void SAL_CALL ConfigurationController::disposing (void) ...@@ -180,18 +176,14 @@ void SAL_CALL ConfigurationController::disposing (void)
if (mpImplementation.get() == NULL) if (mpImplementation.get() == NULL)
return; return;
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::disposing");
OSL_TRACE("ConfigurationController::disposing"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": requesting empty configuration");
OSL_TRACE(" requesting empty configuration\n");
#endif
// To destroy all resources an empty configuration is requested and then, // To destroy all resources an empty configuration is requested and then,
// synchronously, all resulting requests are processed. // synchronously, all resulting requests are processed.
mpImplementation->mpQueueProcessor->Clear(); mpImplementation->mpQueueProcessor->Clear();
restoreConfiguration(new Configuration(this,false)); restoreConfiguration(new Configuration(this,false));
mpImplementation->mpQueueProcessor->ProcessUntilEmpty(); mpImplementation->mpQueueProcessor->ProcessUntilEmpty();
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": all requests processed");
OSL_TRACE(" all requests processed");
#endif
// Now that all resources have been deactivated, mark the controller as // Now that all resources have been deactivated, mark the controller as
// disposed. // disposed.
...@@ -337,19 +329,15 @@ void SAL_CALL ConfigurationController::requestResourceActivation ( ...@@ -337,19 +329,15 @@ void SAL_CALL ConfigurationController::requestResourceActivation (
// we just return silently during that stage. // we just return silently during that stage.
if (rBHelper.bInDispose) if (rBHelper.bInDispose)
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceActivation(): ignoring " <<
OSL_TRACE("ConfigurationController::requestResourceActivation(): ignoring %s\n",
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
return; return;
} }
#if defined VERBOSE && VERBOSE>=2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceActivation() " <<
OSL_TRACE("ConfigurationController::requestResourceActivation() %s\n",
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
if (rxResourceId.is()) if (rxResourceId.is())
{ {
...@@ -395,11 +383,9 @@ void SAL_CALL ConfigurationController::requestResourceDeactivation ( ...@@ -395,11 +383,9 @@ void SAL_CALL ConfigurationController::requestResourceDeactivation (
::osl::MutexGuard aGuard (maMutex); ::osl::MutexGuard aGuard (maMutex);
ThrowIfDisposed(); ThrowIfDisposed();
#if defined VERBOSE && VERBOSE>=2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceDeactivation() " <<
OSL_TRACE("ConfigurationController::requestResourceDeactivation() %s\n",
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
if (rxResourceId.is()) if (rxResourceId.is())
{ {
...@@ -545,14 +531,14 @@ void SAL_CALL ConfigurationController::restoreConfiguration ( ...@@ -545,14 +531,14 @@ void SAL_CALL ConfigurationController::restoreConfiguration (
// Get lists of resources that are to be activated or deactivated. // Get lists of resources that are to be activated or deactivated.
Reference<XConfiguration> xCurrentConfiguration (mpImplementation->mxRequestedConfiguration); Reference<XConfiguration> xCurrentConfiguration (mpImplementation->mxRequestedConfiguration);
#if defined VERBOSE && VERBOSE>=1 #if OSL_DEBUG_LEVEL >=1
OSL_TRACE("ConfigurationController::restoreConfiguration("); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::restoreConfiguration(");
ConfigurationTracer::TraceConfiguration(rxNewConfiguration, "requested configuration"); ConfigurationTracer::TraceConfiguration(rxNewConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration(xCurrentConfiguration, "current configuration"); ConfigurationTracer::TraceConfiguration(xCurrentConfiguration, "current configuration");
#endif #endif
ConfigurationClassifier aClassifier (rxNewConfiguration, xCurrentConfiguration); ConfigurationClassifier aClassifier (rxNewConfiguration, xCurrentConfiguration);
aClassifier.Partition(); aClassifier.Partition();
#if defined VERBOSE && VERBOSE>=3 #if OSL_DEBUG_LEVEL >=2
aClassifier.TraceResourceIdVector( aClassifier.TraceResourceIdVector(
"requested but not current resources:\n", aClassifier.GetC1minusC2()); "requested but not current resources:\n", aClassifier.GetC1minusC2());
aClassifier.TraceResourceIdVector( aClassifier.TraceResourceIdVector(
......
...@@ -41,9 +41,6 @@ using namespace ::com::sun::star::uno; ...@@ -41,9 +41,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework; using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString; using ::rtl::OUString;
#undef VERBOSE
//#define VERBOSE 1
namespace sd { namespace framework { namespace sd { namespace framework {
//===== ConfigurationControllerResourceManager ================================ //===== ConfigurationControllerResourceManager ================================
...@@ -136,20 +133,16 @@ void ConfigurationControllerResourceManager::ActivateResource ( ...@@ -136,20 +133,16 @@ void ConfigurationControllerResourceManager::ActivateResource (
return; return;
} }
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": activating resource " << OUStringToOString(
OSL_TRACE("activating resource %s\n", OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
#endif
// 1. Get the factory. // 1. Get the factory.
const OUString sResourceURL (rxResourceId->getResourceURL()); const OUString sResourceURL (rxResourceId->getResourceURL());
Reference<XResourceFactory> xFactory (mpResourceFactoryContainer->GetFactory(sResourceURL)); Reference<XResourceFactory> xFactory (mpResourceFactoryContainer->GetFactory(sResourceURL));
if ( ! xFactory.is()) if ( ! xFactory.is())
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": no factory found for " <<
OSL_TRACE(" no factory found fo %s\n",
OUStringToOString(sResourceURL, RTL_TEXTENCODING_UTF8).getStr()); OUStringToOString(sResourceURL, RTL_TEXTENCODING_UTF8).getStr());
#endif
return; return;
} }
...@@ -174,9 +167,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( ...@@ -174,9 +167,7 @@ void ConfigurationControllerResourceManager::ActivateResource (
if (xResource.is()) if (xResource.is())
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": successfully created");
OSL_TRACE(" successfully created");
#endif
// 3. Add resource to URL->Object map. // 3. Add resource to URL->Object map.
AddResource(xResource, xFactory); AddResource(xResource, xFactory);
...@@ -191,9 +182,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( ...@@ -191,9 +182,7 @@ void ConfigurationControllerResourceManager::ActivateResource (
} }
else else
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": resource creation failed");
OSL_TRACE(" resource creation failed");
#endif
} }
} }
catch (RuntimeException&) catch (RuntimeException&)
...@@ -219,7 +208,7 @@ void ConfigurationControllerResourceManager::DeactivateResource ( ...@@ -219,7 +208,7 @@ void ConfigurationControllerResourceManager::DeactivateResource (
if ( ! rxResourceId.is()) if ( ! rxResourceId.is())
return; return;
#if defined VERBOSE && VERBOSE>=1 #if OSL_DEBUG_LEVEL >= 1
bool bSuccess (false); bool bSuccess (false);
#endif #endif
try try
...@@ -255,7 +244,7 @@ void ConfigurationControllerResourceManager::DeactivateResource ( ...@@ -255,7 +244,7 @@ void ConfigurationControllerResourceManager::DeactivateResource (
} }
} }
#if defined VERBOSE && VERBOSE>=1 #if OSL_DEBUG_LEVEL >= 1
bSuccess = true; bSuccess = true;
#endif #endif
} }
...@@ -265,13 +254,14 @@ void ConfigurationControllerResourceManager::DeactivateResource ( ...@@ -265,13 +254,14 @@ void ConfigurationControllerResourceManager::DeactivateResource (
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
} }
#if defined VERBOSE && VERBOSE>=1 #if OSL_DEBUG_LEVEL >= 1
if (bSuccess) if (bSuccess)
OSL_TRACE("successfully deactivated %s\n", OUStringToOString( SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": successfully deactivated " << OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr());
else else
OSL_TRACE("activating resource %s failed\n", OUStringToOString( SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": activating resource " << OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()); FrameworkHelper::ResourceIdToString(rxResourceId), RTL_TEXTENCODING_UTF8).getStr()
<< " failed");
#endif #endif
} }
...@@ -294,12 +284,11 @@ void ConfigurationControllerResourceManager::AddResource ( ...@@ -294,12 +284,11 @@ void ConfigurationControllerResourceManager::AddResource (
aDescriptor.mxResourceFactory = rxFactory; aDescriptor.mxResourceFactory = rxFactory;
maResourceMap[rxResource->getResourceId()] = aDescriptor; maResourceMap[rxResource->getResourceId()] = aDescriptor;
#if defined VERBOSE && VERBOSE>=2 #if OSL_DEBUG_LEVEL >= 2
OSL_TRACE("ConfigurationControllerResourceManager::AddResource(): added %s -> %x\n", SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationControllerResourceManager::AddResource(): added " <<
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResource->getResourceId()), FrameworkHelper::ResourceIdToString(rxResource->getResourceId()),
RTL_TEXTENCODING_UTF8).getStr(), RTL_TEXTENCODING_UTF8).getStr() << " -> " << rxResource.get());
rxResource.get());
#endif #endif
} }
...@@ -315,12 +304,12 @@ ConfigurationControllerResourceManager::ResourceDescriptor ...@@ -315,12 +304,12 @@ ConfigurationControllerResourceManager::ResourceDescriptor
ResourceMap::iterator iResource (maResourceMap.find(rxResourceId)); ResourceMap::iterator iResource (maResourceMap.find(rxResourceId));
if (iResource != maResourceMap.end()) if (iResource != maResourceMap.end())
{ {
#if defined VERBOSE && VERBOSE>=2 #if OSL_DEBUG_LEVEL >= 2
OSL_TRACE("ConfigurationControllerResourceManager::RemoveResource(): removing %s -> %x\n", SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationControllerResourceManager::RemoveResource(): removing " <<
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(rxResourceId), FrameworkHelper::ResourceIdToString(rxResourceId),
RTL_TEXTENCODING_UTF8).getStr(), RTL_TEXTENCODING_UTF8).getStr() <<
*iResource); " -> " << &iResource);
#endif #endif
aDescriptor = iResource->second; aDescriptor = iResource->second;
......
...@@ -46,9 +46,6 @@ using ::sd::framework::FrameworkHelper; ...@@ -46,9 +46,6 @@ using ::sd::framework::FrameworkHelper;
using ::rtl::OUString; using ::rtl::OUString;
using ::std::vector; using ::std::vector;
#undef VERBOSE
//#define VERBOSE 2
namespace { namespace {
static const sal_Int32 snShortTimeout (100); static const sal_Int32 snShortTimeout (100);
static const sal_Int32 snNormalTimeout (1000); static const sal_Int32 snNormalTimeout (1000);
...@@ -128,9 +125,7 @@ void ConfigurationUpdater::RequestUpdate ( ...@@ -128,9 +125,7 @@ void ConfigurationUpdater::RequestUpdate (
// Find out whether we really can update the configuration. // Find out whether we really can update the configuration.
if (IsUpdatePossible()) if (IsUpdatePossible())
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration start");
OSL_TRACE("UpdateConfiguration start");
#endif
// Call UpdateConfiguration while that is possible and while someone // Call UpdateConfiguration while that is possible and while someone
// set mbUpdatePending to true in the middle of it. // set mbUpdatePending to true in the middle of it.
...@@ -146,9 +141,7 @@ void ConfigurationUpdater::RequestUpdate ( ...@@ -146,9 +141,7 @@ void ConfigurationUpdater::RequestUpdate (
else else
{ {
mbUpdatePending = true; mbUpdatePending = true;
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": scheduling update for later");
OSL_TRACE("scheduling update for later");
#endif
} }
} }
...@@ -177,9 +170,7 @@ bool ConfigurationUpdater::IsUpdatePossible (void) ...@@ -177,9 +170,7 @@ bool ConfigurationUpdater::IsUpdatePossible (void)
void ConfigurationUpdater::UpdateConfiguration (void) void ConfigurationUpdater::UpdateConfiguration (void)
{ {
#if defined VERBOSE && VERBOSE>=1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration update");
OSL_TRACE("UpdateConfiguration update");
#endif
SetUpdateBeingProcessed(true); SetUpdateBeingProcessed(true);
comphelper::ScopeGuard aScopeGuard ( comphelper::ScopeGuard aScopeGuard (
::boost::bind(&ConfigurationUpdater::SetUpdateBeingProcessed, this, false)); ::boost::bind(&ConfigurationUpdater::SetUpdateBeingProcessed, this, false));
...@@ -192,8 +183,8 @@ void ConfigurationUpdater::UpdateConfiguration (void) ...@@ -192,8 +183,8 @@ void ConfigurationUpdater::UpdateConfiguration (void)
ConfigurationClassifier aClassifier(mxRequestedConfiguration, mxCurrentConfiguration); ConfigurationClassifier aClassifier(mxRequestedConfiguration, mxCurrentConfiguration);
if (aClassifier.Partition()) if (aClassifier.Partition())
{ {
#if defined VERBOSE && VERBOSE>=2 #if OSL_DEBUG_LEVEL >= 2
OSL_TRACE("ConfigurationUpdater::UpdateConfiguration("); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationUpdater::UpdateConfiguration(");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
mxRequestedConfiguration, "requested configuration"); mxRequestedConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
...@@ -224,14 +215,12 @@ void ConfigurationUpdater::UpdateConfiguration (void) ...@@ -224,14 +215,12 @@ void ConfigurationUpdater::UpdateConfiguration (void)
} }
else else
{ {
#if defined VERBOSE && VERBOSE>0 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": nothing to do");
OSL_TRACE("nothing to do"); #if OSL_DEBUG_LEVEL >= 2
#if defined VERBOSE && VERBOSE>=2
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
mxRequestedConfiguration, "requested configuration"); mxRequestedConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
mxCurrentConfiguration, "current configuration"); mxCurrentConfiguration, "current configuration");
#endif
#endif #endif
} }
} }
...@@ -240,10 +229,8 @@ void ConfigurationUpdater::UpdateConfiguration (void) ...@@ -240,10 +229,8 @@ void ConfigurationUpdater::UpdateConfiguration (void)
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
} }
#if defined VERBOSE && VERBOSE>0 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationUpdater::UpdateConfiguration)");
OSL_TRACE("ConfigurationUpdater::UpdateConfiguration)"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration end");
OSL_TRACE("UpdateConfiguration end");
#endif
} }
...@@ -300,7 +287,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie ...@@ -300,7 +287,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie
{ {
try try
{ {
#if defined VERBOSE && VERBOSE>=2 #if OSL_DEBUG_LEVEL >= 2
rClassifier.TraceResourceIdVector( rClassifier.TraceResourceIdVector(
"requested but not current resources:", rClassifier.GetC1minusC2()); "requested but not current resources:", rClassifier.GetC1minusC2());
rClassifier.TraceResourceIdVector( rClassifier.TraceResourceIdVector(
...@@ -316,8 +303,8 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie ...@@ -316,8 +303,8 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie
mpResourceManager->DeactivateResources(rClassifier.GetC2minusC1(), mxCurrentConfiguration); mpResourceManager->DeactivateResources(rClassifier.GetC2minusC1(), mxCurrentConfiguration);
mpResourceManager->ActivateResources(rClassifier.GetC1minusC2(), mxCurrentConfiguration); mpResourceManager->ActivateResources(rClassifier.GetC1minusC2(), mxCurrentConfiguration);
#if defined VERBOSE && VERBOSE>=2 #if OSL_DEBUG_LEVEL >= 2
OSL_TRACE("ConfigurationController::UpdateConfiguration)"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::UpdateConfiguration)");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
mxRequestedConfiguration, "requested configuration"); mxRequestedConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration( ConfigurationTracer::TraceConfiguration(
...@@ -392,12 +379,10 @@ void ConfigurationUpdater::CheckPureAnchors ( ...@@ -392,12 +379,10 @@ void ConfigurationUpdater::CheckPureAnchors (
if (bDeactiveCurrentResource) if (bDeactiveCurrentResource)
{ {
#if defined VERBOSE && VERBOSE>=2 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": deactiving pure anchor " <<
OSL_TRACE("deactiving pure anchor %s because it has no children",
OUStringToOString( OUStringToOString(
FrameworkHelper::ResourceIdToString(xResourceId), FrameworkHelper::ResourceIdToString(xResourceId),
RTL_TEXTENCODING_UTF8).getStr()); RTL_TEXTENCODING_UTF8).getStr() << "because it has no children");
#endif
// Erase element from current configuration. // Erase element from current configuration.
for (sal_Int32 nI=nIndex; nI<nCount-2; ++nI) for (sal_Int32 nI=nIndex; nI<nCount-2; ++nI)
aResources[nI] = aResources[nI+1]; aResources[nI] = aResources[nI+1];
......
...@@ -43,9 +43,6 @@ using namespace ::com::sun::star::drawing::framework; ...@@ -43,9 +43,6 @@ using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString; using ::rtl::OUString;
using ::sd::tools::ConfigurationAccess; using ::sd::tools::ConfigurationAccess;
#undef VERBOSE
//#define VERBOSE 2
namespace sd { namespace framework { namespace sd { namespace framework {
static const sal_uInt32 snFactoryPropertyCount (2); static const sal_uInt32 snFactoryPropertyCount (2);
...@@ -197,20 +194,16 @@ void ModuleController::ProcessFactory (const ::std::vector<Any>& rValues) ...@@ -197,20 +194,16 @@ void ModuleController::ProcessFactory (const ::std::vector<Any>& rValues)
OUString(RTL_CONSTASCII_USTRINGPARAM("URL")), OUString(RTL_CONSTASCII_USTRINGPARAM("URL")),
aURLs); aURLs);
#if defined VERBOSE && VERBOSE>0 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::adding factory " <<
OSL_TRACE("ModuleController::adding factory %s",
OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr()); OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr());
#endif
// Add the resource URLs to the map. // Add the resource URLs to the map.
::std::vector<rtl::OUString>::const_iterator iResource; ::std::vector<rtl::OUString>::const_iterator iResource;
for (iResource=aURLs.begin(); iResource!=aURLs.end(); ++iResource) for (iResource=aURLs.begin(); iResource!=aURLs.end(); ++iResource)
{ {
(*mpResourceToFactoryMap)[*iResource] = sServiceName; (*mpResourceToFactoryMap)[*iResource] = sServiceName;
#if defined VERBOSE && VERBOSE>1 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " <<
OSL_TRACE(" %s",
OUStringToOString(*iResource, RTL_TEXTENCODING_UTF8).getStr()); OUStringToOString(*iResource, RTL_TEXTENCODING_UTF8).getStr());
#endif
} }
} }
...@@ -268,10 +261,8 @@ void ModuleController::ProcessStartupService (const ::std::vector<Any>& rValues) ...@@ -268,10 +261,8 @@ void ModuleController::ProcessStartupService (const ::std::vector<Any>& rValues)
// at the configuration controller. // at the configuration controller.
xGlobalFactory->createInstanceWithArguments(sServiceName, aArguments); xGlobalFactory->createInstanceWithArguments(sServiceName, aArguments);
#if defined VERBOSE && VERBOSE>0 SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::created startup service " <<
OSL_TRACE("ModuleController::created startup service %s",
OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr()); OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8).getStr());
#endif
} }
} }
catch (Exception&) catch (Exception&)
......
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
#include <tools/time.hxx> #include <tools/time.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include "sal/log.hxx"
#undef VERBOSE
namespace sd { namespace tools { namespace sd { namespace tools {
...@@ -148,23 +147,17 @@ IMPL_LINK_NOARG(TimerBasedTaskExecution, TimerCallback) ...@@ -148,23 +147,17 @@ IMPL_LINK_NOARG(TimerBasedTaskExecution, TimerCallback)
// mnMaxTimePerStep. Note that the last step may take longer // mnMaxTimePerStep. Note that the last step may take longer
// than allowed. // than allowed.
sal_uInt32 nStartTime (Time( Time::SYSTEM ).GetMSFromTime()); sal_uInt32 nStartTime (Time( Time::SYSTEM ).GetMSFromTime());
#ifdef VERBOSE SAL_INFO("sd.tools", OSL_THIS_FUNC << ": starting TimerBasedTaskExecution at " << nStartTime);
OSL_TRACE("starting TimerBasedTaskExecution at %d", nStartTime);
#endif
do do
{ {
mpTask->RunNextStep(); mpTask->RunNextStep();
sal_uInt32 nDuration (Time( Time::SYSTEM ).GetMSFromTime()-nStartTime); sal_uInt32 nDuration (Time( Time::SYSTEM ).GetMSFromTime()-nStartTime);
#ifdef VERBOSE SAL_INFO("sd.tools", OSL_THIS_FUNC << ": executed step in " << nDuration);
OSL_TRACE("executed step in %d", nDuration);
#endif
if (nDuration > mnMaxTimePerStep) if (nDuration > mnMaxTimePerStep)
break; break;
} }
while (mpTask->HasNextStep()); while (mpTask->HasNextStep());
#ifdef VERBOSE SAL_INFO("sd.tools", OSL_THIS_FUNC << ": TimerBasedTaskExecution sleeping");
OSL_TRACE("TimerBasedTaskExecution sleeping");
#endif
maTimer.Start(); maTimer.Start();
} }
else else
......
...@@ -1643,9 +1643,7 @@ void ToolBarShellList::UpdateShells ( ...@@ -1643,9 +1643,7 @@ void ToolBarShellList::UpdateShells (
std::insert_iterator<GroupedShellList>(aList,aList.begin())); std::insert_iterator<GroupedShellList>(aList,aList.begin()));
for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell) for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell)
{ {
#ifdef VERBOSE SAL_INFO("sd.view", OSL_THIS_FUNC << ": deactivating tool bar shell " << iShell->mnId);
OSL_TRACE("deactivating tool bar shell %d", iShell->mnId);
#endif
rpManager->DeactivateSubShell(*rpMainViewShell, iShell->mnId); rpManager->DeactivateSubShell(*rpMainViewShell, iShell->mnId);
} }
...@@ -1657,9 +1655,7 @@ void ToolBarShellList::UpdateShells ( ...@@ -1657,9 +1655,7 @@ void ToolBarShellList::UpdateShells (
std::insert_iterator<GroupedShellList>(aList,aList.begin())); std::insert_iterator<GroupedShellList>(aList,aList.begin()));
for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell) for (GroupedShellList::iterator iShell=aList.begin(); iShell!=aList.end(); ++iShell)
{ {
#ifdef VERBOSE SAL_INFO("sd.view", OSL_THIS_FUNC << ": activating tool bar shell " << iShell->mnId);
OSL_TRACE("activating tool bar shell %d", iShell->mnId);
#endif
rpManager->ActivateSubShell(*rpMainViewShell, iShell->mnId); rpManager->ActivateSubShell(*rpMainViewShell, iShell->mnId);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment