BLPAPI C++ 3.26.6
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
37
38#ifndef INCLUDED_BLPAPI_LOGGING
39#define INCLUDED_BLPAPI_LOGGING
40
89
90#ifndef INCLUDED_BLPAPI_CALL
91#include <blpapi_call.h>
92#endif
93
94#ifndef INCLUDED_BLPAPI_DATETIME
95#include <blpapi_datetime.h>
96#endif
97
98#ifndef INCLUDED_BLPAPI_DEFS
99#include <blpapi_defs.h>
100#endif
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
107
110
125typedef void (*blpapi_Logging_Func_t)(blpapi_UInt64_t threadId,
126 int severity,
127 blpapi_Datetime_t timestamp,
128 const char *category,
129 const char *message);
130
145BLPAPI_EXPORT
146int blpapi_Logging_registerCallback(blpapi_Logging_Func_t callback,
147 blpapi_Logging_Severity_t thresholdSeverity);
148
160BLPAPI_EXPORT
161int blpapi_Logging_configureLogging(int level,
162 const char *fileName,
163 int rolloverFileCount,
164 int rolloverFileLimit);
165
174BLPAPI_EXPORT
175void blpapi_Logging_logTestMessage(blpapi_Logging_Severity_t severity);
176
186BLPAPI_EXPORT
187void blpapi_Logging_userMessage(
188 blpapi_Logging_Severity_t severity, const char *message);
189
192
193#ifdef __cplusplus
194}
195
196namespace BloombergLP {
197namespace blpapi {
204
212struct Logging {
213
214 struct Severity {
216 enum Type {
217
218 e_off = blpapi_Logging_SEVERITY_OFF,
219 e_fatal = blpapi_Logging_SEVERITY_FATAL,
220 e_error = blpapi_Logging_SEVERITY_ERROR,
221 e_warn = blpapi_Logging_SEVERITY_WARN,
222 e_info = blpapi_Logging_SEVERITY_INFO,
223 e_debug = blpapi_Logging_SEVERITY_DEBUG,
224 e_trace = blpapi_Logging_SEVERITY_TRACE
225 };
226 };
227
228 // CLASS METHODS
229 static void logTestMessage(Severity::Type severity);
234};
235
238
239// ============================================================================
240// INLINE FUNCTION DEFINITIONS
241// ============================================================================
242
243// --------------
244// struct Logging
245// --------------
246
247// CLASS METHODS
249{
250 BLPAPI_CALL(blpapi_Logging_logTestMessage)
251 (static_cast<blpapi_Logging_Severity_t>(severity));
252}
253
254} // close namespace blpapi
255} // close namespace BloombergLP
256
257#endif
258
259#endif
Provide functions for dispatchtbl.
Represents a date and/or time.
Common definitions used by the library.
Definition blpapi_abstractsession.h:452
Definition blpapi_abstractsession.h:451
Definition blpapi_logging.h:214
Type
Enumeration used to specify different logging severity levels.
Definition blpapi_logging.h:216
@ e_trace
TRACE.
Definition blpapi_logging.h:224
@ e_info
INFO.
Definition blpapi_logging.h:222
@ e_error
ERROR.
Definition blpapi_logging.h:220
@ e_debug
DEBUG.
Definition blpapi_logging.h:223
@ e_warn
WARN.
Definition blpapi_logging.h:221
@ e_fatal
FATAL.
Definition blpapi_logging.h:219
@ e_off
OFF.
Definition blpapi_logging.h:218
Definition blpapi_logging.h:212
static void logTestMessage(Severity::Type severity)
Definition blpapi_logging.h:248