diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-09-08 23:41:20 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-09-08 23:51:41 +0300 |
commit | 5bb0c9d790966fccd8d54336119714e678c87b0e (patch) | |
tree | af6dc4433cfe9e9b3fb663b0c82e2bfb8e7ce7c7 /framework | |
parent | 04c3f9d18501562cb0536dee0fe89334ed7736d1 (diff) |
Use SAL_INFO instead of framework's own "event logging"
That "event logging" consisted of two macros, both used in a single place.
Change-Id: I8faffd9756399f1902e52aa41968b71a964a4324
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/macros/debug.hxx | 6 | ||||
-rw-r--r-- | framework/inc/macros/debug/event.hxx | 116 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 15 |
3 files changed, 13 insertions, 124 deletions
diff --git a/framework/inc/macros/debug.hxx b/framework/inc/macros/debug.hxx index ca47bb62229b..2c2dd8555e7c 100644 --- a/framework/inc/macros/debug.hxx +++ b/framework/inc/macros/debug.hxx @@ -39,18 +39,12 @@ // => "product" (OSL_DEBUG_LEVEL == 0) #else - #undef ENABLE_EVENTDEBUG #undef ENABLE_REGISTRATIONDEBUG #undef ENABLE_FILTERDBG #endif //***************************************************************************************************************** -// special macros for event handling -//***************************************************************************************************************** -#include <macros/debug/event.hxx> - -//***************************************************************************************************************** // special macros to debug service registration //***************************************************************************************************************** #include <macros/debug/registration.hxx> diff --git a/framework/inc/macros/debug/event.hxx b/framework/inc/macros/debug/event.hxx deleted file mode 100644 index 31adff50158b..000000000000 --- a/framework/inc/macros/debug/event.hxx +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_ -#define __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_ - -//************************************************************************************************************* -// special macros for event handling -//************************************************************************************************************* - -#ifdef ENABLE_EVENTDEBUG - - #include <rtl/strbuf.hxx> - - /*_____________________________________________________________________________________________________________ - LOGFILE_EVENTDEBUG - - For follow macros we need a special log file. If user forget to specify anyone, we must do it for him! - _____________________________________________________________________________________________________________*/ - - #ifndef LOGFILE_EVENTDEBUG - #define LOGFILE_EVENTDEBUG \ - "events.log" - #endif - - /*_____________________________________________________________________________________________________________ - LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION ) - - Use this macro to print debug information about sending of events to listener for controlling right order. - ( Use new scope in macro to declare sBuffer more then on time in same "parentscope"! ) - _____________________________________________________________________________________________________________*/ - - #define LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION ) \ - { \ - OStringBuffer sBuffer(1024); \ - sBuffer.append( "[ " ); \ - sBuffer.append( SFRAMETYPE ); \ - sBuffer.append( " ] \"" ); \ - sBuffer.append( U2B( SFRAMENAME ) ); \ - sBuffer.append( "\" send event \"" ); \ - switch( AFRAMEACTION ) \ - { \ - case ::com::sun::star::frame::FrameAction_COMPONENT_ATTACHED : sBuffer.append("COMPONENT ATTACHED" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_COMPONENT_DETACHING : sBuffer.append("COMPONENT DETACHING" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_COMPONENT_REATTACHED : sBuffer.append("COMPONENT REATTACHED" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_FRAME_ACTIVATED : sBuffer.append("FRAME ACTIVATED" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_FRAME_DEACTIVATING : sBuffer.append("FRAME DEACTIVATING" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_CONTEXT_CHANGED : sBuffer.append("CONTEXT CHANGED" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_FRAME_UI_ACTIVATED : sBuffer.append("FRAME UI ACTIVATED" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_FRAME_UI_DEACTIVATING : sBuffer.append("FRAME UI DEACTIVATING" ); \ - break; \ - case ::com::sun::star::frame::FrameAction_MAKE_FIXED_SIZE : sBuffer.append("MAKE_FIXED_SIZE" ); \ - break; \ - default: sBuffer.append("... ERROR: invalid FrameAction detected!" ); \ - break; \ - } \ - sBuffer.append( " ... event to listener.\n\n" ); \ - WRITE_LOGFILE( LOGFILE_EVENTDEBUG, sBuffer.makeStringAndClear() ) \ - } - - /*_____________________________________________________________________________________________________________ - LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME ) - - These macro log information about sending of dispose events to listener. - ( Use new scope in macro to declare sBuffer more then on time in same "parentscope"! ) - _____________________________________________________________________________________________________________*/ - - #define LOG_DISPOSEEVENT( SFRAMETYPE, SFRAMENAME ) \ - { \ - OStringBuffer sBuffer(1024); \ - sBuffer.append( "[ " ); \ - sBuffer.append( SFRAMETYPE ); \ - sBuffer.append( " ] \"" ); \ - sBuffer.append( U2B( SFRAMENAME ) ); \ - sBuffer.append( "\" send dispose event to listener.\n\n"); \ - WRITE_LOGFILE( LOGFILE_EVENTDEBUG, sBuffer.makeStringAndClear() ) \ - } - -#else // #ifdef ENABLE_EVENTDEBUG - - /*_____________________________________________________________________________________________________________ - If right testmode is'nt set - implements these macros empty! - _____________________________________________________________________________________________________________*/ - - #undef LOGFILE_EVENTDEBUG - #define LOG_FRAMEACTIONEVENT( SFRAMETYPE, SFRAMENAME, AFRAMEACTION ) - #define LOG_DISPOSEEVENT( SFRAMETYPE, SFRAMENAME ) - -#endif // #ifdef ENABLE_EVENTDEBUG - -#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_EVENT_HXX_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 9cfde04f13bb..9af43fccc673 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -1833,7 +1833,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException ) // May be we will die before we could finish this method ... css::uno::Reference< css::frame::XFrame > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); - LOG_DISPOSEEVENT( "Frame", sName ) + SAL_INFO("fwk.frame", "[Frame] " << m_sName << " send dispose event to listener"); // First operation should be ... "stopp all listening for window events on our container window". // These events are superflous but can make trouble! @@ -2734,7 +2734,18 @@ void Frame::implts_sendFrameActionEvent( const css::frame::FrameAction& aAction // Log information about order of events to file! // (only activated in debug version!) - LOG_FRAMEACTIONEVENT( "Frame", m_sName, aAction ) + SAL_INFO( "fwk.frame", + "[Frame] " << m_sName << " send event " << + (aAction == css::frame::FrameAction_COMPONENT_ATTACHED ? OUString("COMPONENT ATTACHED") : + (aAction == css::frame::FrameAction_COMPONENT_DETACHING ? OUString("COMPONENT DETACHING") : + (aAction == css::frame::FrameAction_COMPONENT_REATTACHED ? OUString("COMPONENT REATTACHED") : + (aAction == css::frame::FrameAction_FRAME_ACTIVATED ? OUString("FRAME ACTIVATED") : + (aAction == css::frame::FrameAction_FRAME_DEACTIVATING ? OUString("FRAME DEACTIVATING") : + (aAction == css::frame::FrameAction_CONTEXT_CHANGED ? OUString("CONTEXT CHANGED") : + (aAction == css::frame::FrameAction_FRAME_UI_ACTIVATED ? OUString("FRAME UI ACTIVATED") : + (aAction == css::frame::FrameAction_FRAME_UI_DEACTIVATING ? OUString("FRAME UI DEACTIVATING") : + (aAction == css::frame::FrameAction_MAKE_FIXED_SIZE ? OUString("MAKE_FIXED_SIZE") : + OUString("*invalid*"))))))))))); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ // Send css::frame::FrameAction event to all listener. |