diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx index 6d194517bf56..db5fa824b9f5 100644 --- a/cppu/source/AffineBridge/AffineBridge.cxx +++ b/cppu/source/AffineBridge/AffineBridge.cxx @@ -28,19 +28,6 @@ #include "cppu/helper/purpenv/Mapping.hxx" -#ifdef debug -# define LOG_LIFECYCLE_AffineBridge -#endif - -#ifdef LOG_LIFECYCLE_AffineBridge -# include -# define LOG_LIFECYCLE_AffineBridge_emit(x) x - -#else -# define LOG_LIFECYCLE_AffineBridge_emit(x) - -#endif - class InnerThread; class OuterThread; @@ -147,12 +134,12 @@ AffineBridge::AffineBridge() m_outerThreadId(0), m_pOuterThread (nullptr) { - LOG_LIFECYCLE_AffineBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "AffineBridge::AffineBridge(uno_Environment * pEnv)", this)); + SAL_INFO("cppu.affinebridge", "LIFE: AffineBridge::AffineBridge(uno_Environment * pEnv) -> " << this); } AffineBridge::~AffineBridge() { - LOG_LIFECYCLE_AffineBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "AffineBridge::~AffineBridge()", this)); + SAL_INFO("cppu.affinebridge", "LIFE: AffineBridge::~AffineBridge() -> " << this); if (m_pInnerThread && osl::Thread::getCurrentIdentifier() != m_innerThreadId) { diff --git a/cppu/source/UnsafeBridge/UnsafeBridge.cxx b/cppu/source/UnsafeBridge/UnsafeBridge.cxx index 1187f54dbe58..17a375a319dd 100644 --- a/cppu/source/UnsafeBridge/UnsafeBridge.cxx +++ b/cppu/source/UnsafeBridge/UnsafeBridge.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "osl/mutex.hxx" #include "osl/thread.h" #include "osl/thread.hxx" @@ -27,21 +26,6 @@ #include "cppu/helper/purpenv/Environment.hxx" #include "cppu/helper/purpenv/Mapping.hxx" - -#ifdef debug -# define LOG_LIFECYCLE_UnsafeBridge -#endif - -#ifdef LOG_LIFECYCLE_UnsafeBridge -# include -# define LOG_LIFECYCLE_UnsafeBridge_emit(x) x - -#else -# define LOG_LIFECYCLE_UnsafeBridge_emit(x) - -#endif - - class UnsafeBridge : public cppu::Enterable { osl::Mutex m_mutex; @@ -66,12 +50,12 @@ UnsafeBridge::UnsafeBridge() : m_count (0), m_threadId(0) { - LOG_LIFECYCLE_UnsafeBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "UnsafeBridge::UnsafeBridge(uno_Environment * pEnv)", this)); + SAL_INFO("cppu.unsafebridge", "LIFE: UnsafeBridge::UnsafeBridge(uno_Environment * pEnv) -> " << this); } UnsafeBridge::~UnsafeBridge() { - LOG_LIFECYCLE_UnsafeBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "UnsafeBridge::~UnsafeBridge()", this)); + SAL_INFO("cppu.unsafebridge", "LIFE: UnsafeBridge::~UnsafeBridge() -> " << this); SAL_WARN_IF(m_count < 0, "cppu.unsafebridge", "m_count is less than 0"); } diff --git a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx index 449429ffc0b0..9e4925335306 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx @@ -27,20 +27,6 @@ #include "typelib/typedescription.h" #include "osl/interlck.h" -#ifdef debug -# define LOG_LIFECYCLE_cppu_helper_purpenv_Base -#endif - -#ifdef LOG_LIFECYCLE_cppu_helper_purpenv_Base -# include -# define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x) x - -#else -# define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x) - -#endif - - extern "C" { typedef void SAL_CALL EnvFun_P (uno_Environment *); typedef void SAL_CALL EnvFun_PP_P(uno_Environment ** ppHardEnv, uno_Environment *); @@ -241,7 +227,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable) m_env_acquireInterface (pEnv->pExtEnv->acquireInterface), m_env_releaseInterface (pEnv->pExtEnv->releaseInterface) { - LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::Base(uno_Environment * pEnv)", this)); + SAL_INFO("cppu.purpenv", "LIFE: cppu::helper::purpenv::Base::Base(uno_Environment * pEnv) -> " << this); OSL_ENSURE( rtl_ustr_ascii_compare_WithLength(pEnv->pTypeName->buffer, rtl_str_getLength(UNO_LB_UNO), UNO_LB_UNO) == 0, @@ -267,7 +253,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable) Base::~Base() { - LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::~Base()", this)); + SAL_INFO("cppu.purpenv", "LIFE: cppu::helper::purpenv::Base::~Base() -> " << this); m_pEnv->acquire = m_env_acquire; m_pEnv->release = m_env_release; diff --git a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx index 8f46ce7a875a..23c3510a4c9f 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx @@ -27,24 +27,8 @@ #include "uno/dispatcher.h" #include "typelib/typedescription.h" - -#ifdef debug -# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping -#endif - -#ifdef LOG_LIFECYCLE_cppu_helper_purpenv_Mapping -# include -# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(x) x - -#else -# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(x) - -#endif - - using namespace com::sun::star; - class Mapping : public uno_Mapping { uno::Environment m_from; @@ -128,7 +112,7 @@ Mapping::Mapping(uno_Environment * pFrom, m_probeFun(probeFun), m_pContext(pProbeContext) { - LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Mapping::Mapping(uno_Environment * pFrom, uno_Environment * pTo)", this)); + SAL_INFO("cppu.purpenv", "LIFE: Mapping::Mapping(uno_Environment * pFrom, uno_Environment * pTo -> " << this); uno_Mapping::acquire = s_acquire; uno_Mapping::release = s_release; @@ -137,7 +121,7 @@ Mapping::Mapping(uno_Environment * pFrom, Mapping::~Mapping() { - LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Mapping::~Mapping()", this)); + SAL_INFO("cppu.purpenv", "LIFE: Mapping:~Mapping() -> " << this); } diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx index 0b81cea8130d..ae46da96dcad 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx @@ -25,21 +25,8 @@ #include "typelib/typedescription.hxx" #include "cppu/EnvDcp.hxx" - -//#define LOG_LIFECYCLE_Proxy -#ifdef LOG_LIFECYCLE_Proxy -# include -# define LOG_LIFECYCLE_Proxy_emit(x) x - -#else -# define LOG_LIFECYCLE_Proxy_emit(x) - -#endif - - using namespace com::sun::star; - static bool relatesToInterface(typelib_TypeDescription * pTypeDescr) { switch (pTypeDescr->eTypeClass) @@ -222,7 +209,7 @@ Proxy::Proxy(uno::Mapping const & to_from, m_probeFun (probeFun), m_pProbeContext(pProbeContext) { - LOG_LIFECYCLE_Proxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Proxy::Proxy(<>)", this)); + SAL_INFO("cppu.purpenv", "LIFE: Proxy::Proxy(<>) -> " << this); typelib_typedescription_acquire(&m_pTypeDescr->aBase); if (!m_pTypeDescr->aBase.bComplete) @@ -249,7 +236,7 @@ extern "C" { static void s_releaseAndRevoke_v(va_list * pParam) Proxy::~Proxy() { - LOG_LIFECYCLE_Proxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Proxy::~Proxy()", this)); + SAL_INFO("cppu.purpenv", "LIFE: Proxy::~Proxy() -> " << this); uno_Environment_invoke(m_to.get(), s_releaseAndRevoke_v, m_to.get(), m_pUnoI); diff --git a/cppu/source/uno/cascade_mapping.cxx b/cppu/source/uno/cascade_mapping.cxx index ec3147ef59a5..2cd5e43c04b0 100644 --- a/cppu/source/uno/cascade_mapping.cxx +++ b/cppu/source/uno/cascade_mapping.cxx @@ -28,16 +28,6 @@ #include "cascade_mapping.hxx" -#ifdef LOG_LIFECYLE_MediatorMapping -# include -# define LOG_LIFECYLE_MediatorMapping_emit(x) x - -#else -# define LOG_LIFECYLE_MediatorMapping_emit(x) - -#endif - - using namespace com::sun::star; class MediatorMapping : public uno_Mapping @@ -98,7 +88,7 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom, m_interm (pInterm), m_to (pTo) { - LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); + SAL_INFO("cppu.mapping", __FUNCTION__); if (!m_from2uno.get() || !m_uno2to.get()) abort(); @@ -110,19 +100,19 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom, MediatorMapping::~MediatorMapping() { - LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); + SAL_INFO("cppu.mapping", __FUNCTION__); } void MediatorMapping::acquire() { - LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); + SAL_INFO("cppu.mapping", __FUNCTION__); osl_atomic_increment(&m_refCount); } void MediatorMapping::release() { - LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); + SAL_INFO("cppu.mapping", __FUNCTION__); if (osl_atomic_decrement(&m_refCount) == 0) { diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index b657c0b37764..dfc02f597a47 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -101,7 +101,10 @@ certain functionality. @li @c cppu.log @li @c cppu.threadpool @li @c cppu.typelib +@li @c cppu.purpenv +@li @c cppu.mapping @li @c cppu.unsafebridge +@li @c cppu.affinebridge @section cppuhelper