OpendTect-6_4  6.4
debug.h
Go to the documentation of this file.
1 #ifndef debug_h
2 #define debug_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H.Lammertink
9  Date: Jun 2003
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "basicmod.h"
16 #include "gendefs.h"
17 #include "bufstring.h"
18 
19 namespace google_breakpad { class ExceptionHandler; }
20 
33 namespace DBG
34 {
35  mGlobal(Basic) void turnOn( int flag );
37  mGlobal(Basic) bool isOn( int flag=0xffff );
38  mGlobal(Basic) void message( const char* );
39  mGlobal(Basic) void message( int flag, const char* msg );
40 // { if ( isOn(flag) ) message(msg); }
41  mGlobal(Basic) void putProgInfo(int,char**);
43  mGlobal(Basic) void forceCrash(bool withdump);
44  mGlobal(Basic) bool crashOnNaN();
45 };
46 
47 extern "C" {
48 
49  mGlobal(Basic) int od_debug_isOn( int flag );
50  mGlobal(Basic) void od_debug_message( const char* msg );
51  mGlobal(Basic) void od_debug_messagef( int flag, const char* msg );
52  mGlobal(Basic) void od_debug_putProgInfo(int,char**);
53  mGlobal(Basic) void od_putProgInfo(int,char**);
54  mGlobal(Basic) void od_init_test_program(int,char**);
59 }
60 
61 
62 
63 
64 #ifdef HAS_BREAKPAD
65 #define mUseCrashDumper
66 
67 namespace System
68 {
69 
72 mExpClass(Basic) CrashDumper
73 {
74 public:
75  static CrashDumper& getInstance();
77 
78  void sendDump(const char* filename);
79 
80  void setSendAppl(const char* a) { sendappl_ = a; }
81 
82  static FixedString sSenderAppl(); //od_ReportIssue
83  static FixedString sUiSenderAppl(); //od_uiReportIssue
84 
85 private:
86  CrashDumper();
87 
88  void init();
89 
90  static CrashDumper* theinst_;
91 
92  BufferString sendappl_;
93  google_breakpad::ExceptionHandler* handler_;
94 };
95 
96 } // namespace System
97 
98 #endif // HAS_BREAKPAD
99 
100 /*
101  This is a list of reserved debug masks, in order to avoid conflicts.
102  Don't just throw any of these away or change a value, adding new masks
103  should be OK.
104 */
105 
106 #define DBG_DBG 0x0001 // general, low frequency stuff
107 #define DBG_MT 0x0002 // multi-threaded stuff
108 #define DBG_UI 0x0004 // ui-related stuff
109 #define DBG_IO 0x0008 // general I/O stuff
110 #define DBG_SOCKIO 0x0010 // socket I/O
111 #define DBG_MM 0x0020 // Multi-machine batch processing
112 #define DBG_SETTINGS 0x0040 // User settings
113 #define DBG_PROGSTART 0x0080 // Program start and stop
114 #define DBG_FILEPATH 0x0100 // File name handling, conversion, etc.
115 
116 
117 #endif
#define mExpClass(module)
Definition: commondefs.h:160
void turnOn(int flag)
Overrides the envirnonment variable.
bool crashOnNaN()
#define mGlobal(module)
Definition: commondefs.h:163
void message(int flag, const char *msg)
OD::String that holds an existing text string.
Definition: fixedstring.h:29
bool init()
void od_debug_putProgInfo(int, char **)
void od_debug_message(const char *msg)
bool isOn(int flag=0xffff)
int od_debug_isOn(int flag)
void od_debug_messagef(int flag, const char *msg)
void putProgInfo(int, char **)
one line; more if isOn()
Definition: debug.h:19
Defines a generic interface for supplying debug/runtime info.
Definition: debug.h:33
Definition: issuereporter.h:19
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
void forceCrash(bool withdump)
void od_init_test_program(int, char **)
void od_putProgInfo(int, char **)

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019