This is Unofficial EPICS BASE Doxygen Site
osdAssert.c File Reference
#include "dbDefs.h"
#include "epicsPrint.h"
#include "epicsVersion.h"
#include "epicsAssert.h"
#include "epicsThread.h"
#include "epicsTime.h"
#include "cantProceed.h"
#include "epicsStackTrace.h"
+ Include dependency graph for osdAssert.c:

Go to the source code of this file.

Functions

void epicsAssert (const char *pFile, const unsigned line, const char *pExp, const char *pAuthorName)
 

Function Documentation

void epicsAssert ( const char *  pFile,
const unsigned  line,
const char *  pExp,
const char *  pAuthorName 
)

Definition at line 24 of file osdAssert.c.

26 {
27  epicsTimeStamp current;
28 
29  errlogPrintf("\n\n\n"
30  "A call to 'assert(%s)'\n"
31  " by thread '%s' failed in %s line %u.\n",
32  pExp, epicsThreadGetNameSelf(), pFile, line);
33 
35 
36  errlogPrintf("EPICS Release %s.\n", epicsReleaseVersion);
37 
38  if (epicsTimeGetCurrent(&current) == 0) {
39  char date[64];
40 
41  epicsTimeToStrftime(date, sizeof(date),
42  "%Y-%m-%d %H:%M:%S.%f %Z", &current);
43  errlogPrintf("Local time is %s\n", date);
44  }
45 
46  if (!pAuthorName) {
47  pAuthorName = "the author";
48  }
49  errlogPrintf("Please E-mail this message to %s or to tech-talk@aps.anl.gov\n",
50  pAuthorName);
51 
52  errlogPrintf("Calling epicsThreadSuspendSelf()\n");
54 }
LIBCOM_API const char *epicsStdCall epicsThreadGetNameSelf(void)
Definition: osdThread.c:846
LIBCOM_API size_t epicsStdCall epicsTimeToStrftime(char *pBuff, size_t bufLength, const char *pFormat, const epicsTimeStamp *pTS)
Convert epicsTimeStamp to string. See epicsTime::strftime()
Definition: epicsTime.cpp:1120
LIBCOM_API void epicsStdCall epicsThreadSuspendSelf(void)
Definition: osdThread.c:664
char * line
Definition: reader.c:25
int epicsStdCall epicsTimeGetCurrent(epicsTimeStamp *pDest)
Get current time into *pDest.
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
void epicsStackTrace(void)
void date(const char *format)
EPICS time stamp, for use from C code.
Definition: epicsTime.h:33