haiku/src/servers/app/DebugInfoManager.h
Stephan Aßmus 5211328a37 turn off on-screen debugging for now, the errors it reported are not that critical, and printing the debug info itself could lead to problems
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-10 13:38:22 +00:00

49 lines
1.1 KiB
C++

/*
* Copyright 2005, Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Class used to manage global access to on-screen debugging info
* in the RootLayer class.
*
*/
#ifndef DEBUG_INFO_MANAGER_H
#define DEBUG_INFO_MANAGER_H
#include <OS.h>
#if __HAIKU__
# define ON_SCREEN_DEBUGGING_INFO 0
#else
# define ON_SCREEN_DEBUGGING_INFO 0
#endif
#if ON_SCREEN_DEBUGGING_INFO
extern char* gDebugString;
# define CRITICAL(x) { sprintf(gDebugString, (x)); DebugInfoManager::Default()->AddInfo(gDebugString); }
#else
//# define CRITICAL(x) debugger (x)
# define CRITICAL(x) ;
#endif // ON_SCREEN_DEBUGGING_INFO
class DebugInfoManager {
public:
virtual ~DebugInfoManager();
static DebugInfoManager *Default();
void AddInfo(const char* string);
private:
DebugInfoManager();
static DebugInfoManager *sDefaultInstance;
#if ON_SCREEN_DEBUGGING_INFO
friend class RootLayer;
void SetRootLayer(RootLayer* layer);
RootLayer *fRootLayer;
#endif // ON_SCREEN_DEBUGGING_INFO
};
#endif // DEBUG_INFO_H