#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include "libComAPI.h"
#include "compilerDependencies.h"
Go to the source code of this file.
|
LIBCOM_API int | errlogPrintf (const char *pformat,...) EPICS_PRINTF_STYLE(1 |
|
LIBCOM_API int LIBCOM_API int | errlogVprintf (const char *pformat, va_list pvar) |
|
LIBCOM_API int | errlogSevPrintf (const errlogSevEnum severity, const char *pformat,...) EPICS_PRINTF_STYLE(2 |
|
LIBCOM_API int LIBCOM_API int | errlogSevVprintf (const errlogSevEnum severity, const char *pformat, va_list pvar) |
|
LIBCOM_API int | errlogMessage (const char *message) |
|
LIBCOM_API const char * | errlogGetSevEnumString (errlogSevEnum severity) |
|
LIBCOM_API void | errlogSetSevToLog (errlogSevEnum severity) |
|
LIBCOM_API errlogSevEnum | errlogGetSevToLog (void) |
|
LIBCOM_API void | errlogAddListener (errlogListener listener, void *pPrivate) |
|
LIBCOM_API int | errlogRemoveListeners (errlogListener listener, void *pPrivate) |
|
LIBCOM_API int | eltc (int yesno) |
|
LIBCOM_API int | errlogSetConsole (FILE *stream) |
|
LIBCOM_API int | errlogInit (int bufsize) |
|
LIBCOM_API int | errlogInit2 (int bufsize, int maxMsgSize) |
|
LIBCOM_API void | errlogFlush (void) |
|
LIBCOM_API void | errPrintf (long status, const char *pFileName, int lineno, const char *pformat,...) EPICS_PRINTF_STYLE(4 |
|
LIBCOM_API void LIBCOM_API int | errlogPrintfNoConsole (const char *pformat,...) EPICS_PRINTF_STYLE(1 |
|
LIBCOM_API void LIBCOM_API int LIBCOM_API int | errlogVprintfNoConsole (const char *pformat, va_list pvar) |
|
LIBCOM_API void | errSymLookup (long status, char *pBuf, size_t bufLength) |
|
#define errMessage |
( |
|
S, |
|
|
|
PM |
|
) |
| errPrintf(S, __FILE__, __LINE__, "%s", PM) |
typedef void(* errlogListener) (void *pPrivate, const char *message) |
Enumerator |
---|
errlogInfo |
|
errlogMinor |
|
errlogMajor |
|
errlogFatal |
|
Definition at line 26 of file errlog.h.
LIBCOM_API int eltc |
( |
int |
yesno | ) |
|
Definition at line 368 of file errlog.c.
372 pvtData.toConsole = yesno;
int errlogInit(int bufsize)
LIBCOM_API void errlogAddListener |
( |
errlogListener |
listener, |
|
|
void * |
pPrivate |
|
) |
| |
Definition at line 317 of file errlog.c.
326 "errlogAddListener");
330 ellAdd(&pvtData.listenerList,&plistenerNode->
node);
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
int errlogInit(int bufsize)
void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
LIBCOM_API void * callocMustSucceed(size_t count, size_t size, const char *msg)
A calloc() that never returns NULL.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
LIBCOM_API void errlogFlush |
( |
void |
| ) |
|
Definition at line 529 of file errlog.c.
539 count =
ellCount(&pvtData.msgQueue);
#define ellCount(PLIST)
Report the number of nodes in a list.
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
LIBCOM_API void epicsEventMustWait(epicsEventId id)
Wait for an event (see epicsEventWait()).
int errlogInit(int bufsize)
#define epicsEventSignal(ID)
A synonym for epicsEventTrigger().
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
LIBCOM_API const char* errlogGetSevEnumString |
( |
errlogSevEnum |
severity | ) |
|
Definition at line 297 of file errlog.c.
int errlogInit(int bufsize)
LIBCOM_API const char * errlogSevEnumString[]
Definition at line 311 of file errlog.c.
314 return pvtData.sevToLog;
int errlogInit(int bufsize)
LIBCOM_API int errlogInit |
( |
int |
bufsize | ) |
|
Definition at line 524 of file errlog.c.
int errlogInit2(int bufsize, int maxMsgSize)
LIBCOM_API int errlogInit2 |
( |
int |
bufsize, |
|
|
int |
maxMsgSize |
|
) |
| |
Definition at line 500 of file errlog.c.
517 if (pvtData.errlogInitFailed) {
518 fprintf(
stderr,
"errlogInit failed\n");
#define EPICS_THREAD_ONCE_INIT
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
LIBCOM_API int errlogMessage |
( |
const char * |
message | ) |
|
Definition at line 180 of file errlog.c.
int errlogPrintf(const char *pFormat,...)
LIBCOM_API int errlogPrintf |
( |
const char * |
pformat, |
|
|
|
... |
|
) |
| |
LIBCOM_API void LIBCOM_API int errlogPrintfNoConsole |
( |
const char * |
pformat, |
|
|
|
... |
|
) |
| |
LIBCOM_API int errlogRemoveListeners |
( |
errlogListener |
listener, |
|
|
void * |
pPrivate |
|
) |
| |
Definition at line 334 of file errlog.c.
344 while (plistenerNode) {
348 plistenerNode->
pPrivate == pPrivate) {
353 plistenerNode = pnext;
363 "errlogRemoveListeners: No listeners found\n");
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
int errlogInit(int bufsize)
#define ellNext(PNODE)
Find the next node in list.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API int errlogSetConsole |
( |
FILE * |
stream | ) |
|
Definition at line 376 of file errlog.c.
379 pvtData.console = stream;
int errlogInit(int bufsize)
Definition at line 305 of file errlog.c.
308 pvtData.sevToLog = severity;
int errlogInit(int bufsize)
LIBCOM_API int errlogSevPrintf |
( |
const errlogSevEnum |
severity, |
|
|
const char * |
pformat, |
|
|
|
... |
|
) |
| |
LIBCOM_API int LIBCOM_API int errlogSevVprintf |
( |
const errlogSevEnum |
severity, |
|
|
const char * |
pformat, |
|
|
va_list |
pvar |
|
) |
| |
Definition at line 262 of file errlog.c.
271 (
"errlogSevVprintf called from interrupt level\n");
280 pnext = msgbufGetFree(isOkToBlock);
285 pnext += nchar; totalChar += nchar;
286 nchar = tvsnPrint(pnext, pvtData.maxMsgSize - totalChar - 1, pFormat, pvar);
287 pnext += nchar; totalChar += nchar;
288 if (pnext[-1] !=
'\n') {
292 msgbufSetSize(totalChar);
int errlogInit(int bufsize)
LIBCOM_API int epicsInterruptIsInterruptContext(void)
LIBCOM_API void epicsInterruptContextMessage(const char *message)
int epicsStdCall epicsThreadIsOkToBlock(void)
const char * errlogGetSevEnumString(errlogSevEnum severity)
LIBCOM_API int LIBCOM_API int errlogVprintf |
( |
const char * |
pformat, |
|
|
va_list |
pvar |
|
) |
| |
Definition at line 144 of file errlog.c.
153 (
"errlogVprintf called from interrupt level\n");
162 pbuffer = msgbufGetFree(isOkToBlock);
164 console = pvtData.console ? pvtData.console :
stderr;
165 vfprintf(console, pFormat, pvar);
170 nchar = tvsnPrint(pbuffer, pvtData.maxMsgSize, pFormat?pFormat:
"", pvar);
171 if (pvtData.atExit || (isOkToBlock && pvtData.toConsole)) {
172 console = pvtData.console ? pvtData.console :
stderr;
173 fprintf(console,
"%s", pbuffer);
176 msgbufSetSize(nchar);
int errlogInit(int bufsize)
LIBCOM_API int epicsInterruptIsInterruptContext(void)
LIBCOM_API void epicsInterruptContextMessage(const char *message)
int epicsStdCall epicsThreadIsOkToBlock(void)
LIBCOM_API void LIBCOM_API int LIBCOM_API int errlogVprintfNoConsole |
( |
const char * |
pformat, |
|
|
va_list |
pvar |
|
) |
| |
Definition at line 204 of file errlog.c.
211 (
"errlogVprintfNoConsole called from interrupt level\n");
219 pbuffer = msgbufGetFree(1);
223 nchar = tvsnPrint(pbuffer, pvtData.maxMsgSize, pFormat?pFormat:
"", pvar);
224 msgbufSetSize(nchar);
int errlogInit(int bufsize)
LIBCOM_API int epicsInterruptIsInterruptContext(void)
LIBCOM_API void epicsInterruptContextMessage(const char *message)
LIBCOM_API void errPrintf |
( |
long |
status, |
|
|
const char * |
pFileName, |
|
|
int |
lineno, |
|
|
const char * |
pformat, |
|
|
|
... |
|
) |
| |
LIBCOM_API void errSymLookup |
( |
long |
status, |
|
|
char * |
pBuf, |
|
|
size_t |
bufLength |
|
) |
| |
Definition at line 190 of file errSymLib.c.
192 const char* msg = errSymLookupInternal(
status);
194 strncpy(pBuf, msg, bufLength-1);
195 pBuf[bufLength-1] =
'\0';
198 errRawCopy(
status, pBuf, bufLength);
LIBCOM_API const char* errlogSevEnumString[] |
LIBCOM_API int errVerbose |