-rw-r--r-- | libopie2/opiecore/odebug.cpp | 12 | ||||
-rw-r--r-- | libopie2/opiecore/odebug.h | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp index 3bffdd0..d8dfe26 100644 --- a/libopie2/opiecore/odebug.cpp +++ b/libopie2/opiecore/odebug.cpp | |||
@@ -140,27 +140,27 @@ void DebugBackend::debug(unsigned short level, unsigned int, const QString& data | |||
140 | 140 | ||
141 | // gcc 2.9x is dumb and sucks... can you hear it? | 141 | // gcc 2.9x is dumb and sucks... can you hear it? |
142 | //QString areaName = (oApp) ? oApp->appName() : "<unknown>"; | 142 | //QString areaName = (oApp) ? oApp->appName() : "<unknown>"; |
143 | QString areaName; | 143 | QString areaName; |
144 | if ( oApp ) areaName = oApp->appName(); | 144 | if ( oApp ) areaName = oApp->appName(); |
145 | else areaName = "<unknown>"; | 145 | else areaName = "<unknown>"; |
146 | 146 | ||
147 | switch( m_outp ) { | 147 | switch( m_outp ) { |
148 | case -1: // ignore | 148 | case ODEBUG_IGNORE: |
149 | return; | 149 | return; |
150 | case 0: // File | 150 | case ODEBUG_FILE: |
151 | return debugFile( areaName, data ); | 151 | return debugFile( areaName, data ); |
152 | case 1: // Message Box | 152 | case ODEBUG_MSGBOX: |
153 | return debugMsgB( areaName, data ); | 153 | return debugMsgB( areaName, data ); |
154 | case 2: | 154 | case ODEBUG_STDERR: |
155 | return debugShel( areaName,data ); | 155 | return debugShel( areaName,data ); |
156 | case 3: // syslog | 156 | case ODEBUG_SYSLOG: |
157 | return debugSysl( priority, data ); | 157 | return debugSysl( priority, data ); |
158 | case 4: // socket | 158 | case ODEBUG_SOCKET: |
159 | return debugSock( areaName, data ); | 159 | return debugSock( areaName, data ); |
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | inline void DebugBackend::debugFile(const QString& area, const QString& data) { | 163 | inline void DebugBackend::debugFile(const QString& area, const QString& data) { |
164 | /* something went wrong with the file don't bother.. */ | 164 | /* something went wrong with the file don't bother.. */ |
165 | if ( m_opened && !m_file ) | 165 | if ( m_opened && !m_file ) |
166 | return; | 166 | return; |
diff --git a/libopie2/opiecore/odebug.h b/libopie2/opiecore/odebug.h index 3851a41..21a6c26 100644 --- a/libopie2/opiecore/odebug.h +++ b/libopie2/opiecore/odebug.h | |||
@@ -62,16 +62,23 @@ class ondbgstream; | |||
62 | #define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] " | 62 | #define o_lineinfo "[" << __FILE__ << ":" << __LINE__ << "] " |
63 | 63 | ||
64 | #define owarn Opie::Core::odWarning() | 64 | #define owarn Opie::Core::odWarning() |
65 | #define oerr Opie::Core::odError() | 65 | #define oerr Opie::Core::odError() |
66 | #define odebug Opie::Core::odDebug() | 66 | #define odebug Opie::Core::odDebug() |
67 | #define ofatal Opie::Core::odFatal() | 67 | #define ofatal Opie::Core::odFatal() |
68 | #define oendl "\n" | 68 | #define oendl "\n" |
69 | 69 | ||
70 | const int ODEBUG_IGNORE = -1; | ||
71 | const int ODEBUG_FILE = 0; | ||
72 | const int ODEBUG_MSGBOX = 1; | ||
73 | const int ODEBUG_STDERR = 2; | ||
74 | const int ODEBUG_SYSLOG = 3; | ||
75 | const int ODEBUG_SOCKET = 4; | ||
76 | |||
70 | class odbgstreamprivate; | 77 | class odbgstreamprivate; |
71 | /** | 78 | /** |
72 | * odbgstream is a text stream that allows you to print debug messages. | 79 | * odbgstream is a text stream that allows you to print debug messages. |
73 | * Using the overloaded "<<" operator you can send messages. Usually | 80 | * Using the overloaded "<<" operator you can send messages. Usually |
74 | * you do not create the odbgstream yourself, but use @ref odDebug() (odebug) | 81 | * you do not create the odbgstream yourself, but use @ref odDebug() (odebug) |
75 | * @ref odWarning() (owarn), @ref odError() (oerr) or @ref odFatal (ofatal) to obtain one. | 82 | * @ref odWarning() (owarn), @ref odError() (oerr) or @ref odFatal (ofatal) to obtain one. |
76 | * | 83 | * |
77 | * Example: | 84 | * Example: |
@@ -392,17 +399,17 @@ class ondbgstream { | |||
392 | ondbgstream& operator<<( const QTime& ) { return *this; } | 399 | ondbgstream& operator<<( const QTime& ) { return *this; } |
393 | ondbgstream& operator<<( const QPoint & ) { return *this; } | 400 | ondbgstream& operator<<( const QPoint & ) { return *this; } |
394 | ondbgstream& operator<<( const QSize & ) { return *this; } | 401 | ondbgstream& operator<<( const QSize & ) { return *this; } |
395 | ondbgstream& operator<<( const QRect & ) { return *this; } | 402 | ondbgstream& operator<<( const QRect & ) { return *this; } |
396 | ondbgstream& operator<<( const QRegion & ) { return *this; } | 403 | ondbgstream& operator<<( const QRegion & ) { return *this; } |
397 | ondbgstream& operator<<( const QStringList & ) { return *this; } | 404 | ondbgstream& operator<<( const QStringList & ) { return *this; } |
398 | ondbgstream& operator<<( const QColor & ) { return *this; } | 405 | ondbgstream& operator<<( const QColor & ) { return *this; } |
399 | ondbgstream& operator<<( const QBrush & ) { return *this; } | 406 | ondbgstream& operator<<( const QBrush & ) { return *this; } |
400 | 407 | ||
401 | private: | 408 | private: |
402 | class Private; | 409 | class Private; |
403 | Private *d; | 410 | Private *d; |
404 | }; | 411 | }; |
405 | 412 | ||
406 | /*====================================================================================== | 413 | /*====================================================================================== |
407 | * related functions | 414 | * related functions |
408 | *======================================================================================*/ | 415 | *======================================================================================*/ |