*** empty log message ***

svn path=/trunk/boinc/; revision=5670
This commit is contained in:
Rom Walton 2005-03-16 20:29:43 +00:00
parent e6f77d0e03
commit 5957f2d593
3 changed files with 162 additions and 39 deletions

View File

@ -25989,3 +25989,16 @@ Rom 15 Mar 2005
ViewResources.cpp, .h
ViewTransfers.cpp, .h
ViewWork.cpp, .h
Rom 16 Mar 2005
- Implement the diagnostics functions for platforms other than Windows.
NOTE: I was working in this area a bit since I'm trying to track down
why E@H isn't always able to display graphics during a start screen saver
request. The changes here and some build environment changes should
now allow us to build a debug E@H application with debug BOINC API
libraries and now see additional information reported to stderr_txt as
the application tries to identify/transition into the calling desktop.
lib/
diagnostics.C, .h

View File

@ -429,7 +429,7 @@ int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){
// to the CRT so it can be reported via the normal means.
//
void boinc_trace(const char *pszFormat, ...) {
static char szBuffer[1024];
static char szBuffer[4096];
// Trace messages should only be reported if running as a standalone
// application or told too.
@ -453,9 +453,8 @@ void boinc_trace(const char *pszFormat, ...) {
// Converts the BOINCINFO macro into a single string and report it
// to stderr so it can be reported via the normal means.
//
void boinc_info_debug(const char *pszFormat, ...)
{
static char szBuffer[1024];
void boinc_info_debug(const char *pszFormat, ...){
static char szBuffer[4096];
memset(szBuffer, 0, sizeof(szBuffer));
@ -476,9 +475,8 @@ void boinc_info_debug(const char *pszFormat, ...)
// Converts the BOINCINFO macro into a single string and report it
// to stderr so it can be reported via the normal means.
//
void boinc_info_release(const char *pszFormat, ...)
{
static char szBuffer[1024];
void boinc_info_release(const char *pszFormat, ...){
static char szBuffer[4096];
memset(szBuffer, 0, sizeof(szBuffer));
@ -495,6 +493,91 @@ void boinc_info_release(const char *pszFormat, ...)
#endif // _DEBUG
#else // _WIN32
#ifdef _DEBUG
// Converts the BOINCTRACE macro into a single string and report it
// to the CRT so it can be reported via the normal means.
//
void boinc_trace(const char *pszFormat, ...) {
static char szBuffer[4096];
// Trace messages should only be reported if running as a standalone
// application or told too.
if ((flags & BOINC_DIAG_TRACETOSTDERR) ||
(flags & BOINC_DIAG_TRACETOSTDOUT) ) {
memset(szBuffer, 0, sizeof(szBuffer));
va_list ptr;
va_start(ptr, pszFormat);
BOINCASSERT( -1 != _vsnprintf(szBuffer, sizeof(szBuffer), pszFormat, ptr) );
va_end(ptr);
if (flags & BOINC_DIAG_TRACETOSTDERR ) {
fprintf( stderr, "TRACE: %s", szBuffer );
fflush( stderr );
}
if (flags & BOINC_DIAG_TRACETOSTDOUT ) {
fprintf( stdout, "TRACE: %s", szBuffer );
fflush( stdout );
}
}
}
// Converts the BOINCINFO macro into a single string and report it
// to stderr so it can be reported via the normal means.
//
void boinc_info_debug(const char *pszFormat, ...){
static char szBuffer[4096];
memset(szBuffer, 0, sizeof(szBuffer));
va_list ptr;
va_start(ptr, pszFormat);
BOINCASSERT( -1 != _vsnprintf(szBuffer, sizeof(szBuffer), pszFormat, ptr) );
va_end(ptr);
fprintf( stderr, "%s", szBuffer );
fflush( stderr );
}
#else // _DEBUG
// Converts the BOINCINFO macro into a single string and report it
// to stderr so it can be reported via the normal means.
//
void boinc_info_release(const char *pszFormat, ...){
static char szBuffer[4096];
memset(szBuffer, 0, sizeof(szBuffer));
va_list ptr;
va_start(ptr, pszFormat);
_vsnprintf(szBuffer, sizeof(szBuffer), pszFormat, ptr);
va_end(ptr);
fprintf( stderr, "%s", szBuffer );
fflush( stderr );
}
#endif // _DEBUG
#endif // _WIN32

View File

@ -31,6 +31,10 @@
#include <assert.h>
#endif
#ifndef _WIN32
#include <signal.h>
#endif
// flags for boinc_init_diagnostics()
//
@ -54,6 +58,45 @@
#define BOINC_DIAG_STDOUT "stdout"
#ifdef __cplusplus
extern "C" {
#endif
// These are functions common to all platforms
extern int boinc_init_diagnostics(int flags);
extern int boinc_finish_diag();
extern int boinc_install_signal_handlers();
extern int diagnostics_init(
int flags, const char* stdout_prefix, const char* stderr_prefix
);
extern int diagnostics_cycle_logs();
// These are functions that are specific to Unix
#ifndef _WIN32
extern void boinc_set_signal_handler(int sig, void(*handler)(int));
extern void boinc_set_signal_handler_force(int sig, void(*handler)(int));
#endif
// These functions are used to log the various messages that are
// defined in the BOINC Diagnostics Library
extern void boinc_trace(const char *pszFormat, ...);
extern void boinc_info_debug(const char *pszFormat, ...);
extern void boinc_info_release(const char *pszFormat, ...);
#ifdef __cplusplus
}
#endif
#ifdef _WIN32
// Define macros for both debug and release builds.
@ -62,11 +105,6 @@
// C Runtime Libraries to trap and report the asserts and traces.
//
// Forward declare so we can assign a macro to it.
void boinc_trace(const char *pszFormat, ...);
void boinc_info_debug(const char *pszFormat, ...);
void boinc_info_release(const char *pszFormat, ...);
#ifdef _DEBUG
#if defined(WXDEBUG) || defined(WXNDEBUG)
@ -97,19 +135,25 @@ void boinc_info_release(const char *pszFormat, ...);
#endif // _DEBUG
#else // non-Win starts here
#include <signal.h>
#else
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#ifdef _DEBUG
extern void boinc_set_signal_handler(int sig, void(*handler)(int));
extern void boinc_set_signal_handler_force(int sig, void(*handler)(int));
// Standard Frameworks
//
#define BOINCASSERT assert
#define BOINCTRACE boinc_trace
#define BOINCINFO boinc_info_debug
#else // _DEBUG
#define BOINCASSERT(expr) __noop
#define BOINCTRACE __noop
#define BOINCINFO boinc_info_release
#endif // _DEBUG
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // ! _WIN32
@ -130,21 +174,4 @@ extern void boinc_set_signal_handler_force(int sig, void(*handler)(int));
#define BOINCINFO __noop
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern int boinc_init_diagnostics(int flags);
extern int boinc_finish_diag();
extern int boinc_install_signal_handlers();
extern int diagnostics_init(
int flags, const char* stdout_prefix, const char* stderr_prefix
);
extern int diagnostics_cycle_logs();
#ifdef __cplusplus
}
#endif
#endif