git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
summary skin for channel selection
[enigma2.git]
/
lib
/
base
/
eerror.cpp
diff --git
a/lib/base/eerror.cpp
b/lib/base/eerror.cpp
index a84118793a91d377c9dfe7eeb6b390f261fb6edd..4093d0120b6902f3bc6f3ac68a07539c2ab1b562 100644
(file)
--- a/
lib/base/eerror.cpp
+++ b/
lib/base/eerror.cpp
@@
-1,4
+1,5
@@
#include <lib/base/eerror.h>
#include <lib/base/eerror.h>
+#include <lib/base/elock.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@
-6,8
+7,6
@@
#include <string>
#include <string>
-// #include <lib/gui/emessage.h>
-
#ifdef MEMLEAK_CHECK
AllocList *allocList;
pthread_mutex_t memLock =
#ifdef MEMLEAK_CHECK
AllocList *allocList;
pthread_mutex_t memLock =
@@
-67,18
+66,16
@@
void DumpUnfreed()
printf("Total Unfreed: %d bytes\n", totalSize);
fflush(stdout);
};
printf("Total Unfreed: %d bytes\n", totalSize);
fflush(stdout);
};
-#else
- #include <lib/base/elock.h>
#endif
#endif
-int infatal=0;
-
Signal2<void, int, const std::string&> logOutput;
int logOutputConsole=1;
Signal2<void, int, const std::string&> logOutput;
int logOutputConsole=1;
-
pthread_mutex_t signal
Lock =
+
static pthread_mutex_t Debug
Lock =
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
+extern void bsodFatal();
+
void eFatal(const char* fmt, ...)
{
char buf[1024];
void eFatal(const char* fmt, ...)
{
char buf[1024];
@@
-86,19
+83,10
@@
void eFatal(const char* fmt, ...)
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
- singleLock s(
signal
Lock);
- logOutput(lvlFatal,
buf
);
+ singleLock s(
Debug
Lock);
+ logOutput(lvlFatal,
"FATAL: " + std::string(buf) + "\n"
);
fprintf(stderr, "FATAL: %s\n",buf );
fprintf(stderr, "FATAL: %s\n",buf );
-#if 0
- if (!infatal)
- {
- infatal=1;
- eMessageBox msg(buf, "FATAL ERROR", eMessageBox::iconError|eMessageBox::btOK);
- msg.show();
- msg.exec();
- }
-#endif
- _exit(0);
+ bsodFatal();
}
#ifdef DEBUG
}
#ifdef DEBUG
@@
-109,7
+97,7
@@
void eDebug(const char* fmt, ...)
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
- singleLock s(
signal
Lock);
+ singleLock s(
Debug
Lock);
logOutput(lvlDebug, std::string(buf) + "\n");
if (logOutputConsole)
fprintf(stderr, "%s\n", buf);
logOutput(lvlDebug, std::string(buf) + "\n");
if (logOutputConsole)
fprintf(stderr, "%s\n", buf);
@@
-122,7
+110,7
@@
void eDebugNoNewLine(const char* fmt, ...)
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
- singleLock s(
signal
Lock);
+ singleLock s(
Debug
Lock);
logOutput(lvlDebug, buf);
if (logOutputConsole)
fprintf(stderr, "%s", buf);
logOutput(lvlDebug, buf);
if (logOutputConsole)
fprintf(stderr, "%s", buf);
@@
-135,7
+123,7
@@
void eWarning(const char* fmt, ...)
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
va_start(ap, fmt);
vsnprintf(buf, 1024, fmt, ap);
va_end(ap);
- singleLock s(
signal
Lock);
+ singleLock s(
Debug
Lock);
logOutput(lvlWarning, std::string(buf) + "\n");
if (logOutputConsole)
fprintf(stderr, "%s\n", buf);
logOutput(lvlWarning, std::string(buf) + "\n");
if (logOutputConsole)
fprintf(stderr, "%s\n", buf);
@@
-144,9
+132,12
@@
void eWarning(const char* fmt, ...)
void ePythonOutput(const char *string)
{
void ePythonOutput(const char *string)
{
+#ifdef DEBUG
+ singleLock s(DebugLock);
logOutput(lvlWarning, string);
if (logOutputConsole)
fwrite(string, 1, strlen(string), stderr);
logOutput(lvlWarning, string);
if (logOutputConsole)
fwrite(string, 1, strlen(string), stderr);
+#endif
}
void eWriteCrashdump()
}
void eWriteCrashdump()