Unit Test Framework C and Traditional C++ API Reference
test_log.h
1/*
2 * (c) Copyright, Real-Time Innovations, 2002-2022.
3 * All rights reserved.
4 * No duplications, whole or partial, manual or electronic, may be made
5 * without express written permission. Any such copies, or
6 * revisions thereof, must display this notice unaltered.
7 * This code contains trade secrets of Real-Time Innovations, Inc.
8 */
9
10#ifndef rtitest_log_h
11#define rtitest_log_h
12
13#include "rtitest/test_types.h"
14#include "rtitest/test_dll.h"
15#include "rtitest/test_connext_interface.h"
16#include <stdlib.h>
17
31#ifdef __cplusplus
32extern "C" {
33#endif
34
42typedef unsigned int RTITestLogBitmap;
43
44struct RTITestLogMessage {
45 const char *format;
46};
47
52#define RTI_TEST_LOG_BIT_FATAL_ERROR (0x00000001U)
53
58#define RTI_TEST_LOG_BIT_EXCEPTION (0x00000002U)
59
64#define RTI_TEST_LOG_BIT_WARN (0x00000004U)
65
70#define RTI_TEST_LOG_BIT_LOCAL (0x00000008U)
71
78#define RTI_TEST_LOG_BIT_REMOTE (0x00000010U)
85#define RTI_TEST_LOG_BIT_PERIODIC (0x00000020U)
86
91#define RTI_TEST_LOG_BITMAP_DEFAULT \
92 (RTI_TEST_LOG_BIT_FATAL_ERROR | RTI_TEST_LOG_BIT_EXCEPTION)
93
98#define RTI_TEST_LOG_BITMAP_NONE (0x00000000U)
99
104extern RTITestDllVariable RTITestLogBitmap RTITestLog_g_instrumentationMask;
105
106#ifdef RTI_LINUX
107 #define RTI_TEST_CHECK_FORMAT_STRING_PARAMETERS(mirrorFunc__, format__, args__) \
108 __attribute__((format(mirrorFunc__, format__, args__)))
109#else
110 #define RTI_TEST_CHECK_FORMAT_STRING_PARAMETERS(mirrorFunc__, format__, args__)
111#endif
112
118extern RTITestDllExport void RTITestLogger_logMessage(
119 const char *method,
120 const struct RTITestLogMessage *logMessage,
121 const char *parameterizedString,
122 ...) RTI_TEST_CHECK_FORMAT_STRING_PARAMETERS(printf, 3, 4);
123
139extern RTITestDllExport void RTITestLog_setBitmaps(
140 RTITestLogBitmap instrumentationMask);
141
148extern RTITestDllExport void RTITestLog_getBitmaps(
149 RTITestLogBitmap *instrumentationMask);
150
161#define RTI_TEST_LOG_VERBOSITY_NONE (0U)
162
167#define RTI_TEST_LOG_VERBOSITY_FATAL (1U)
168
173#define RTI_TEST_LOG_VERBOSITY_EXCEPTION (2U)
174
179#define RTI_TEST_LOG_VERBOSITY_WARNING (3U)
180
185#define RTI_TEST_LOG_VERBOSITY_LOCAL (4U)
186
192#define RTI_TEST_LOG_VERBOSITY_REMOTE (5U)
193
199#define RTI_TEST_LOG_VERBOSITY_PERIODIC (6U)
200
212extern RTITestDllExport void RTITestLog_setBitmapsFromVerbosity(
213 unsigned int verbosity);
214
229extern RTITestDllExport int RTITestLog_snprintf(
230 char *str,
231 size_t size,
232 const char *format,
233 ...);
234
235#ifdef __cplusplus
236} /* extern "C" */
237#endif
238
239#include "rtitest/test_log_msg.h"
240/* pick up hidden performance boosting macros */
241#include "rtitest/test_log_impl.h"
242
243#endif /* rtitest_log_h */
RTITestLogBitmap RTITestLog_g_instrumentationMask
Current log bitmap.
void RTITestLog_setBitmapsFromVerbosity(unsigned int verbosity)
Sets log verbosity from a number, enabling several bitmaps at the same time. See the RTI_TEST_LOG_VER...
void void RTITestLog_setBitmaps(RTITestLogBitmap instrumentationMask)
Sets current log verbosity based on the provided bitmap. See RTITestLog_setBitmapsFromVerbosity() as ...
void RTITestLog_getBitmaps(RTITestLogBitmap *instrumentationMask)
Gets current log verbosity.