EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
11 #ifndef INC_errlog_H
12 #define INC_errlog_H
13 
28 #include <stdarg.h>
29 #include <stddef.h>
30 #include <stdio.h>
31 
32 #include "libComAPI.h"
33 #include "compilerDependencies.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
45 typedef void (*errlogListener)(void *pPrivate, const char *message);
46 
48 typedef enum {
49  errlogInfo,
50  errlogMinor,
51  errlogMajor,
52  errlogFatal
54 
56 LIBCOM_API extern int errVerbose;
57 
58 
59 #ifdef ERRLOG_INIT
60  const char *errlogSevEnumString[] = {
61  "info",
62  "minor",
63  "major",
64  "fatal"
65  };
66 #else
67 
68  LIBCOM_API extern const char * errlogSevEnumString[];
69 #endif
70 
84 #define errMessage(S, PM) \
85  errPrintf(S, __FILE__, __LINE__, "%s", PM)
86 
88 #define epicsPrintf errlogPrintf
89 
91 #define epicsVprintf errlogVprintf
92 
98 LIBCOM_API int errlogPrintf(const char *pformat, ...)
99  EPICS_PRINTF_STYLE(1,2);
100 
106 LIBCOM_API int errlogVprintf(const char *pformat, va_list pvar);
107 
118 LIBCOM_API int errlogSevPrintf(const errlogSevEnum severity,
119  const char *pformat, ...) EPICS_PRINTF_STYLE(2,3);
120 
134 LIBCOM_API int errlogSevVprintf(const errlogSevEnum severity,
135  const char *pformat, va_list pvar);
136 
142 LIBCOM_API int errlogMessage(const char *message);
143 
150 LIBCOM_API const char * errlogGetSevEnumString(errlogSevEnum severity);
151 
157 LIBCOM_API void errlogSetSevToLog(errlogSevEnum severity);
158 
164 LIBCOM_API errlogSevEnum errlogGetSevToLog(void);
165 
172 LIBCOM_API void errlogAddListener(errlogListener listener, void *pPrivate);
173 
180 LIBCOM_API int errlogRemoveListeners(errlogListener listener,
181  void *pPrivate);
182 
191 LIBCOM_API int eltc(int yesno);
192 
199 LIBCOM_API int errlogSetConsole(FILE *stream);
200 
206 LIBCOM_API int errlogInit(int bufsize);
207 
215 LIBCOM_API int errlogInit2(int bufsize, int maxMsgSize);
216 
218 LIBCOM_API void errlogFlush(void);
219 
237 LIBCOM_API void errPrintf(long status, const char *pFileName, int lineno,
238  const char *pformat, ...) EPICS_PRINTF_STYLE(4,5);
239 
240 LIBCOM_API int errlogPrintfNoConsole(const char *pformat, ...)
241  EPICS_PRINTF_STYLE(1,2);
242 LIBCOM_API int errlogVprintfNoConsole(const char *pformat,va_list pvar);
243 
251 LIBCOM_API void errSymLookup(long status, char *pBuf, size_t bufLength);
252 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #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)
void(* errlogListener)(void *pPrivate, const char *message)
Definition: errlog.h:45
errlogSevEnum
Definition: errlog.h:48
LIBCOM_API int errlogMessage(const char *message)
LIBCOM_API errlogSevEnum errlogGetSevToLog(void)
LIBCOM_API int errlogSetConsole(FILE *stream)
LIBCOM_API const char * errlogGetSevEnumString(errlogSevEnum severity)
LIBCOM_API int errlogInit(int bufsize)
Compiler specific declarations.
LIBCOM_API int LIBCOM_API int errlogVprintf(const char *pformat, va_list pvar)
LIBCOM_API void errSymLookup(long status, char *pBuf, size_t bufLength)
LIBCOM_API int eltc(int yesno)
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)
LIBCOM_API int errlogPrintf(const char *pformat,...) EPICS_PRINTF_STYLE(1
LIBCOM_API int errVerbose
LIBCOM_API void errlogFlush(void)
LIBCOM_API void errlogSetSevToLog(errlogSevEnum severity)
LIBCOM_API int LIBCOM_API int errlogSevVprintf(const errlogSevEnum severity, const char *pformat, va_list pvar)
LIBCOM_API void errlogAddListener(errlogListener listener, void *pPrivate)
LIBCOM_API const char * errlogSevEnumString[]