examples/scene_example/debug.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 João Borrego
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
25 #include <iostream>
26 #include <string.h>
27 
29 #define VERBOSE
30 
32 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
33 
34 #ifdef VERBOSE
35 #define debugPrint(x) do { std::cout << x; } while (0)
37 #else
38 #define debugPrint(x) do {} while (0)
39 #endif
40 
41 #ifdef VERBOSE
42 #define debugPrintTrace(x) do {\
44  std::cout << __FILENAME__ << ":" << __LINE__ << ":" << __func__ << ": " << \
45  x << "\n";\
46 } while (0)
47 #else
48 #define debugPrintTrace(x) do {} while (0)
49 #endif