EPICS Base  7.0.5.1
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 
55 LIBCOM_API extern int errVerbose;
56 
57 
58 #ifdef ERRLOG_INIT
59  const char *errlogSevEnumString[] = {
60  "info",
61  "minor",
62  "major",
63  "fatal"
64  };
65 #else
66  LIBCOM_API extern const char * errlogSevEnumString[];
67 #endif
68 
82 #define errMessage(S, PM) \
83  errPrintf(S, __FILE__, __LINE__, "%s", PM)
84 
86 #define epicsPrintf errlogPrintf
87 
89 #define epicsVprintf errlogVprintf
90 
96 LIBCOM_API int errlogPrintf(const char *pformat, ...)
97  EPICS_PRINTF_STYLE(1,2);
98 
104 LIBCOM_API int errlogVprintf(const char *pformat, va_list pvar);
105 
116 LIBCOM_API int errlogSevPrintf(const errlogSevEnum severity,
117  const char *pformat, ...) EPICS_PRINTF_STYLE(2,3);
118 
132 LIBCOM_API int errlogSevVprintf(const errlogSevEnum severity,
133  const char *pformat, va_list pvar);
134 
140 LIBCOM_API int errlogMessage(const char *message);
141 
148 LIBCOM_API const char * errlogGetSevEnumString(errlogSevEnum severity);
149 
155 LIBCOM_API void errlogSetSevToLog(errlogSevEnum severity);
156 
162 LIBCOM_API errlogSevEnum errlogGetSevToLog(void);
163 
170 LIBCOM_API void errlogAddListener(errlogListener listener, void *pPrivate);
171 
178 LIBCOM_API int errlogRemoveListeners(errlogListener listener,
179  void *pPrivate);
180 
189 LIBCOM_API int eltc(int yesno);
190 
197 LIBCOM_API int errlogSetConsole(FILE *stream);
198 
204 LIBCOM_API int errlogInit(int bufsize);
205 
213 LIBCOM_API int errlogInit2(int bufsize, int maxMsgSize);
214 
216 LIBCOM_API void errlogFlush(void);
217 
234 LIBCOM_API void errPrintf(long status, const char *pFileName, int lineno,
235  const char *pformat, ...) EPICS_PRINTF_STYLE(4,5);
236 
237 LIBCOM_API int errlogPrintfNoConsole(const char *pformat, ...)
238  EPICS_PRINTF_STYLE(1,2);
239 LIBCOM_API int errlogVprintfNoConsole(const char *pformat,va_list pvar);
240 
248 LIBCOM_API void errSymLookup(long status, char *pBuf, size_t bufLength);
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #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)
errlogSevEnum
Definition: errlog.h:48
LIBCOM_API int errlogMessage(const char *message)
LIBCOM_API errlogSevEnum errlogGetSevToLog(void)
LIBCOM_API int errlogSetConsole(FILE *stream)
void(* errlogListener)(void *pPrivate, const char *message)
Definition: errlog.h:45
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 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)