Kaydet (Commit) 5bb0c9d7 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 04c3f9d1
...@@ -39,17 +39,11 @@ ...@@ -39,17 +39,11 @@
// => "product" (OSL_DEBUG_LEVEL == 0) // => "product" (OSL_DEBUG_LEVEL == 0)
#else #else
#undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG #undef ENABLE_REGISTRATIONDEBUG
#undef ENABLE_FILTERDBG #undef ENABLE_FILTERDBG
#endif #endif
//*****************************************************************************************************************
// special macros for event handling
//*****************************************************************************************************************
#include <macros/debug/event.hxx>
//***************************************************************************************************************** //*****************************************************************************************************************
// special macros to debug service registration // special macros to debug service registration
//***************************************************************************************************************** //*****************************************************************************************************************
......
/* -*- 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: */
...@@ -1833,7 +1833,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException ) ...@@ -1833,7 +1833,7 @@ void SAL_CALL Frame::dispose() throw( css::uno::RuntimeException )
// May be we will die before we could finish this method ... // 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 ); 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". // First operation should be ... "stopp all listening for window events on our container window".
// These events are superflous but can make trouble! // These events are superflous but can make trouble!
...@@ -2734,7 +2734,18 @@ void Frame::implts_sendFrameActionEvent( const css::frame::FrameAction& aAction ...@@ -2734,7 +2734,18 @@ void Frame::implts_sendFrameActionEvent( const css::frame::FrameAction& aAction
// Log information about order of events to file! // Log information about order of events to file!
// (only activated in debug version!) // (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 ----------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
// Send css::frame::FrameAction event to all listener. // Send css::frame::FrameAction event to all listener.
......
...@@ -158,6 +158,7 @@ certain functionality. ...@@ -158,6 +158,7 @@ certain functionality.
@li @c fwk.autorecovery @li @c fwk.autorecovery
@li @c fwk.desktop @li @c fwk.desktop
@li @c fwk.dispatch @li @c fwk.dispatch
@li @c fwk.frame
@li @c fwk.joburl @li @c fwk.joburl
@li @c fwk.loadenv @li @c fwk.loadenv
@li @c fwk.session @li @c fwk.session
......
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