This is Unofficial EPICS BASE Doxygen Site
errlog.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2014 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 #ifndef INC_errlog_H
11 #define INC_errlog_H
12 
13 #include <stdarg.h>
14 #include <stddef.h>
15 #include <stdio.h>
16 
17 #include "libComAPI.h"
18 #include "compilerDependencies.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 typedef void (*errlogListener)(void *pPrivate, const char *message);
25 
26 typedef enum {
32 
33 LIBCOM_API extern int errVerbose;
34 
35 
36 #ifdef ERRLOG_INIT
37  const char *errlogSevEnumString[] = {
38  "info",
39  "minor",
40  "major",
41  "fatal"
42  };
43 #else
44  LIBCOM_API extern const char * errlogSevEnumString[];
45 #endif
46 
47 /* errMessage is a macro so it can get the file and line number */
48 #define errMessage(S, PM) \
49  errPrintf(S, __FILE__, __LINE__, "%s", PM)
50 /* epicsPrintf and epicsVprintf are old names for errlog routines*/
51 #define epicsPrintf errlogPrintf
52 #define epicsVprintf errlogVprintf
53 
54 LIBCOM_API int errlogPrintf(const char *pformat, ...)
55  EPICS_PRINTF_STYLE(1,2);
56 LIBCOM_API int errlogVprintf(const char *pformat, va_list pvar);
57 LIBCOM_API int errlogSevPrintf(const errlogSevEnum severity,
58  const char *pformat, ...) EPICS_PRINTF_STYLE(2,3);
59 LIBCOM_API int errlogSevVprintf(const errlogSevEnum severity,
60  const char *pformat, va_list pvar);
61 LIBCOM_API int errlogMessage(const char *message);
62 
63 LIBCOM_API const char * errlogGetSevEnumString(errlogSevEnum severity);
64 LIBCOM_API void errlogSetSevToLog(errlogSevEnum severity);
65 LIBCOM_API errlogSevEnum errlogGetSevToLog(void);
66 
67 LIBCOM_API void errlogAddListener(errlogListener listener, void *pPrivate);
68 LIBCOM_API int errlogRemoveListeners(errlogListener listener,
69  void *pPrivate);
70 
71 LIBCOM_API int eltc(int yesno);
72 LIBCOM_API int errlogSetConsole(FILE *stream);
73 
74 LIBCOM_API int errlogInit(int bufsize);
75 LIBCOM_API int errlogInit2(int bufsize, int maxMsgSize);
76 LIBCOM_API void errlogFlush(void);
77 
78 LIBCOM_API void errPrintf(long status, const char *pFileName, int lineno,
79  const char *pformat, ...) EPICS_PRINTF_STYLE(4,5);
80 
81 LIBCOM_API int errlogPrintfNoConsole(const char *pformat, ...)
82  EPICS_PRINTF_STYLE(1,2);
83 LIBCOM_API int errlogVprintfNoConsole(const char *pformat,va_list pvar);
84 
85 LIBCOM_API void errSymLookup(long status, char *pBuf, size_t bufLength);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /*INC_errlog_H*/
LIBCOM_API int errlogSevPrintf(const errlogSevEnum severity, const char *pformat,...) EPICS_PRINTF_STYLE(2
LIBCOM_API int errlogRemoveListeners(errlogListener listener, void *pPrivate)
Definition: errlog.c:334
pvd::Status status
int lineno
Definition: antelope.c:33
errlogSevEnum
Definition: errlog.h:26
LIBCOM_API int errlogMessage(const char *message)
Definition: errlog.c:180
LIBCOM_API errlogSevEnum errlogGetSevToLog(void)
Definition: errlog.c:311
LIBCOM_API int errlogSetConsole(FILE *stream)
Definition: errlog.c:376
int bufsize
Definition: errlog.c:461
void(* errlogListener)(void *pPrivate, const char *message)
Definition: errlog.h:24
LIBCOM_API const char * errlogGetSevEnumString(errlogSevEnum severity)
Definition: errlog.c:297
LIBCOM_API int errlogInit(int bufsize)
Definition: errlog.c:524
LIBCOM_API int LIBCOM_API int errlogVprintf(const char *pformat, va_list pvar)
Definition: errlog.c:144
#define EPICS_PRINTF_STYLE(f, a)
int maxMsgSize
Definition: errlog.c:79
LIBCOM_API void errSymLookup(long status, char *pBuf, size_t bufLength)
Definition: errSymLib.c:190
LIBCOM_API int eltc(int yesno)
Definition: errlog.c:368
LIBCOM_API void errPrintf(long status, const char *pFileName, int lineno, const char *pformat,...) EPICS_PRINTF_STYLE(4
LIBCOM_API int errlogInit2(int bufsize, int maxMsgSize)
Definition: errlog.c:500
LIBCOM_API int errlogPrintf(const char *pformat,...) EPICS_PRINTF_STYLE(1
LIBCOM_API int errVerbose
Definition: errlog.c:41
LIBCOM_API void errlogFlush(void)
Definition: errlog.c:529
LIBCOM_API void errlogSetSevToLog(errlogSevEnum severity)
Definition: errlog.c:305
LIBCOM_API int LIBCOM_API int errlogSevVprintf(const errlogSevEnum severity, const char *pformat, va_list pvar)
Definition: errlog.c:262
Compiler specific declarations.
LIBCOM_API void LIBCOM_API int LIBCOM_API int errlogVprintfNoConsole(const char *pformat, va_list pvar)
Definition: errlog.c:204
LIBCOM_API void LIBCOM_API int errlogPrintfNoConsole(const char *pformat,...) EPICS_PRINTF_STYLE(1
LIBCOM_API void errlogAddListener(errlogListener listener, void *pPrivate)
Definition: errlog.c:317
LIBCOM_API const char * errlogSevEnumString[]