xref: /trunk/main/slideshow/source/inc/debug.hxx (revision aaef562f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_SLIDESHOW_DEBUG_HXX
25 #define INCLUDED_SLIDESHOW_DEBUG_HXX
26 
27 #include <osl/diagnose.h>
28 
29 #if OSL_DEBUG_LEVEL > 1
30 
31 #include "animationnode.hxx"
32 
33 
34 namespace slideshow { namespace internal {
35 
36 void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode);
37 
38 // Change this to a valid filename.  The file is created anew with every
39 // office start (and execution of at least one TRACE... command.)
40 #define TRACE_LOG_FILE_NAME "d:\\tmp\\log.txt"
41 
42 class DebugTraceScope
43 {
44 public:
45     DebugTraceScope (const sal_Char* sFormat, ...);
46     ~DebugTraceScope (void);
47 private:
48     static const sal_Int32 mnBufferSize = 512;
49     sal_Char* msMessage;
50 };
51 
52 void SAL_CALL DebugTraceBegin (const sal_Char* sFormat, ...);
53 void SAL_CALL DebugTraceEnd (const sal_Char* sFormat, ...);
54 void SAL_CALL DebugTraceMessage (const sal_Char* sFormat, ...);
55 
56 } } // end of namespace ::slideshow::internal
57 
58 
59 #define TRACE_BEGIN DebugTraceBegin
60 #define TRACE_END   DebugTraceEnd
61 #define TRACE       DebugTraceMessage
62 #define TRACE_SCOPE DebugTraceScope aTraceScope
63 
64 #else // OSL_DEBUG_LEVEL > 1
65 
66 #define TRACE_BEGIN 1 ? ((void)0) : DebugTraceBegin
67 #define TRACE_END   1 ? ((void)0) : DebugTraceEnd
68 #define TRACE       1 ? ((void)0) : DebugTraceMessage
69 #define TRACE_SCOPE
70 
71 #endif // OSL_DEBUG_LEVEL > 1
72 
73 #endif
74