pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
logger.h
1
7#ifndef LOGGER_H_
8#define LOGGER_H_
9
10#include <string>
11
12#include <compilerDependencies.h>
13#include <shareLib.h>
14
15namespace epics {
16namespace pvAccess {
17
18typedef enum { logLevelAll = 0, logLevelTrace, logLevelDebug, logLevelInfo,
19 logLevelWarn, logLevelError, logLevelFatal, logLevelOff
20 } pvAccessLogLevel;
21/*
22ALL
23 The ALL has the lowest possible rank and is intended to turn on all logging.
24TRACE
25 The TRACE Level designates finer-grained informational events than the DEBUG
26DEBUG
27 The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
28INFO
29 The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
30WARN
31 The WARN level designates potentially harmful situations.
32ERROR
33 The ERROR level designates error events that might still allow the application to continue running.
34FATAL
35 The FATAL level designates very severe error events that will presumably lead the application to abort.
36OFF
37 The OFF has the highest possible rank and is intended to turn off logging.
38*/
39
40
41epicsShareFunc void pvAccessLog(pvAccessLogLevel level, const char* format, ...) EPICS_PRINTF_STYLE(2, 3);
42epicsShareFunc void pvAccessSetLogLevel(pvAccessLogLevel level);
43epicsShareFunc bool pvAccessIsLoggable(pvAccessLogLevel level);
44
45#if defined (__GNUC__) && __GNUC__ < 3
46#define LOG(level, format, ARGS...) pvAccessLog(level, format, ##ARGS)
47#else
48#define LOG(level, format, ...) pvAccessLog(level, format, ##__VA_ARGS__)
49#endif
50#define SET_LOG_LEVEL(level) pvAccessSetLogLevel(level)
51#define IS_LOGGABLE(level) pvAccessIsLoggable(level)
52
53// EPICS errlog
54//#define LOG errlogSevPrintf
55//#define SET_LOG_LEVEL(level) errlogSetSevToLog(level)
56
57// none
58//#define LOG(level, fmt, ...)
59//#define SET_LOG_LEVEL(level)
60
61}
62}
63
64#endif /* LOGGER_H_ */
Copyright - See the COPYRIGHT that is included with this distribution.