BLPAPI C++ 3.26.5
Loading...
Searching...
No Matches
blpapi_logging.h
Go to the documentation of this file.
1/* Copyright 2012. Bloomberg Finance L.P.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to
5 * deal in the Software without restriction, including without limitation the
6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 * sell copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions: The above
9 * copyright notice and this permission notice shall be included in all copies
10 * or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18 * IN THE SOFTWARE.
19 */
20
35
36#ifndef INCLUDED_BLPAPI_LOGGING
37#define INCLUDED_BLPAPI_LOGGING
38
91
92#ifndef INCLUDED_BLPAPI_CALL
93#include <blpapi_call.h>
94#endif
95
96#ifndef INCLUDED_BLPAPI_DATETIME
97#include <blpapi_datetime.h>
98#endif
99
100#ifndef INCLUDED_BLPAPI_DEFS
101#include <blpapi_defs.h>
102#endif
103
104#ifdef __cplusplus
105extern "C" {
106#endif
107
109
112
113typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId,
114 int severity,
115 blpapi_Datetime_t timestamp,
116 const char *category,
117 const char *message);
128
129BLPAPI_EXPORT
130int blpapi_Logging_registerCallback(blpapi_Logging_Func_t callback,
131 blpapi_Logging_Severity_t thresholdSeverity);
142
143BLPAPI_EXPORT
144int blpapi_Logging_configureLogging(int level,
145 const char *fileName,
146 int rolloverFileCount,
147 int rolloverFileLimit);
152
153BLPAPI_EXPORT
154void blpapi_Logging_logTestMessage(blpapi_Logging_Severity_t severity);
159
160BLPAPI_EXPORT
161void blpapi_Logging_userMessage(
162 blpapi_Logging_Severity_t severity, const char *message);
167
170
171#ifdef __cplusplus
172}
173
180
181namespace BloombergLP {
182namespace blpapi {
183
191struct Logging {
192
193 struct Severity {
195 enum Type {
196
197 e_off = blpapi_Logging_SEVERITY_OFF,
198 e_fatal = blpapi_Logging_SEVERITY_FATAL,
199 e_error = blpapi_Logging_SEVERITY_ERROR,
200 e_warn = blpapi_Logging_SEVERITY_WARN,
201 e_info = blpapi_Logging_SEVERITY_INFO,
202 e_debug = blpapi_Logging_SEVERITY_DEBUG,
203 e_trace = blpapi_Logging_SEVERITY_TRACE
204 };
205 };
206
207 // CLASS METHODS
208 static void logTestMessage(Severity::Type severity);
213};
214
217
218// ============================================================================
219// INLINE FUNCTION DEFINITIONS
220// ============================================================================
221
222// --------------
223// struct Logging
224// --------------
225
226// CLASS METHODS
228{
229 BLPAPI_CALL(blpapi_Logging_logTestMessage)
230 (static_cast<blpapi_Logging_Severity_t>(severity));
231}
232
233} // close namespace blpapi
234} // close namespace BloombergLP
235
236#endif
237
238#endif
Provide functions for dispatchtbl.
#define BLPAPI_CALL(FUNCNAME)
Definition blpapi_call.h:361
Represents a date and/or time.
Common definitions used by the library.
Definition blpapi_abstractsession.h:212
Definition blpapi_abstractsession.h:211
Definition blpapi_logging.h:193
Type
Enumeration used to specify different logging severity levels.
Definition blpapi_logging.h:195
@ e_trace
TRACE.
Definition blpapi_logging.h:203
@ e_info
INFO.
Definition blpapi_logging.h:201
@ e_error
ERROR.
Definition blpapi_logging.h:199
@ e_debug
DEBUG.
Definition blpapi_logging.h:202
@ e_warn
WARN.
Definition blpapi_logging.h:200
@ e_fatal
FATAL.
Definition blpapi_logging.h:198
@ e_off
OFF.
Definition blpapi_logging.h:197
Definition blpapi_logging.h:191
static void logTestMessage(Severity::Type severity)
Definition blpapi_logging.h:227