better message
This commit is contained in:
@@ -1577,22 +1577,27 @@ void cac::vSignal ( int ca_status, const char *pfilenm,
|
||||
"Fatal"
|
||||
};
|
||||
|
||||
this->printf ( "CA.Client.Diagnostic..............................................\n" );
|
||||
this->printf ( "CA.Client.Exception...............................................\n" );
|
||||
|
||||
this->printf ( " %s: \"%s\"\n",
|
||||
severity[ CA_EXTRACT_SEVERITY ( ca_status ) ],
|
||||
ca_message ( ca_status ) );
|
||||
|
||||
if ( pFormat ) {
|
||||
this->printf ( " Context: \"" );
|
||||
this->printf ( "Context: \"" );
|
||||
this->vPrintf ( pFormat, args );
|
||||
this->printf ( "\"\n" );
|
||||
}
|
||||
|
||||
if (pfilenm) {
|
||||
this->printf ( " Source File: %s Line Number: %d\n",
|
||||
if ( pfilenm ) {
|
||||
this->printf ( " Source File: %s line %d\n",
|
||||
pfilenm, lineno );
|
||||
}
|
||||
|
||||
epicsTime current = epicsTime::getCurrent ();
|
||||
char date[64];
|
||||
current.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
|
||||
this->printf ( " Current Time: %s\n", date );
|
||||
|
||||
/*
|
||||
* Terminate execution if unsuccessful
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "epicsVersion.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsTime.h"
|
||||
#include "cantProceed.h"
|
||||
|
||||
/*
|
||||
@@ -46,38 +47,39 @@ epicsShareFunc void epicsShareAPI
|
||||
epicsAssert (const char *pFile, const unsigned line,
|
||||
const char *pExp, const char *pAuthorName)
|
||||
{
|
||||
epicsTimeStamp current;
|
||||
char date[64];
|
||||
int status;
|
||||
|
||||
errlogPrintf (
|
||||
"\n\n\nA call to \"assert (%s)\" failed in %s line %d.\n", pExp, pFile, line);
|
||||
|
||||
errlogPrintf (
|
||||
"The file \"core\" will be created in the current working directory.\n");
|
||||
"EPICS release %s.\n", epicsReleaseVersion );
|
||||
|
||||
status = epicsTimeGetCurrent ( & current );
|
||||
|
||||
if ( status == 0 ) {
|
||||
|
||||
epicsTimeToStrftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f", & current );
|
||||
|
||||
errlogPrintf (
|
||||
"Current time %s.\n", date );
|
||||
|
||||
}
|
||||
|
||||
if ( ! pAuthorName ) {
|
||||
pAuthorName = "the author";
|
||||
}
|
||||
|
||||
errlogPrintf (
|
||||
"Please save this file and the text of this message in order to assist\n");
|
||||
"Please E-mail this message to %s or to tech-talk@aps.anl.gov\n",
|
||||
pAuthorName );
|
||||
|
||||
errlogPrintf (
|
||||
"in diagnosing this problem.\n");
|
||||
errlogPrintf (
|
||||
"Calling epicsThreadSuspendSelf()\n" );
|
||||
|
||||
if (pAuthorName) {
|
||||
|
||||
errlogPrintf (
|
||||
"Please send the text of this message to \"%s\"\n", pAuthorName);
|
||||
|
||||
errlogPrintf (
|
||||
"(the author of this call to assert()) or to \"tech-talk@aps.anl.gov\"\n");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
errlogPrintf (
|
||||
"Please contact the author of this software or else send the text of\n");
|
||||
|
||||
errlogPrintf (
|
||||
"this message to \"tech-talk@aps.anl.gov\"\n");
|
||||
|
||||
}
|
||||
errlogPrintf ("This problem occurred in \"%s\"\n", epicsReleaseVersion);
|
||||
errlogPrintf("calling epicsThreadSuspendSelf()\n");
|
||||
epicsThreadSuspendSelf();
|
||||
epicsThreadSuspendSelf ();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsVersion.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "epicsTime.h"
|
||||
|
||||
/*
|
||||
* epicsAssert ()
|
||||
@@ -52,6 +53,9 @@ epicsShareFunc void epicsShareAPI epicsAssert (const char *pFile, const unsigned
|
||||
const char *pAuthorName)
|
||||
{
|
||||
epicsThreadId threadid = epicsThreadGetIdSelf();
|
||||
epicsTimeStamp current;
|
||||
char date[64];
|
||||
int status;
|
||||
|
||||
epicsPrintf (
|
||||
"\n\n\n%s: A call to \"assert (%s)\" failed in %s at %d\n",
|
||||
@@ -60,29 +64,29 @@ epicsShareFunc void epicsShareAPI epicsAssert (const char *pFile, const unsigned
|
||||
pFile,
|
||||
line);
|
||||
|
||||
if (pAuthorName) {
|
||||
status = epicsTimeGetCurrent ( & current );
|
||||
if ( status == 0 ) {
|
||||
epicsTimeToStrftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f", & current );
|
||||
epicsPrintf (
|
||||
"Current time %s.\n", date );
|
||||
}
|
||||
|
||||
epicsPrintf (
|
||||
"Please send a copy of the output from \"tt (%p)\" and a copy of this message\n",
|
||||
threadid);
|
||||
epicsPrintf (
|
||||
"EPICS Release %s.\n", epicsReleaseVersion );
|
||||
|
||||
epicsPrintf (
|
||||
"to \"%s\" (the author of this call to assert()) or \"tech-talk@aps.anl.gov\"\n",
|
||||
if ( ! pAuthorName ) {
|
||||
pAuthorName = "the author";
|
||||
}
|
||||
|
||||
epicsPrintf (
|
||||
"Please E-mail this message and the output from \"tt (%p)\"\n",
|
||||
threadid );
|
||||
|
||||
epicsPrintf (
|
||||
"to %s or to tech-talk@aps.anl.gov\n",
|
||||
pAuthorName);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
epicsPrintf (
|
||||
"Please send a copy of the output from \"tt (%p)\" and a copy of this message\n",
|
||||
threadid);
|
||||
|
||||
epicsPrintf (
|
||||
"to the author or \"tech-talk@aps.anl.gov\"\n");
|
||||
|
||||
}
|
||||
epicsPrintf ("This problem occurred in \"%s\"\n", epicsReleaseVersion);
|
||||
|
||||
epicsThreadSuspendSelf ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user