Adding two more debug macros for logging scalar values to file.

The two added macros simplifies the logging code when a value which is not stored in a variable should be logged.

BUG=

Review URL: https://codereview.webrtc.org/1488613002

Cr-Commit-Position: refs/heads/master@{#10870}
This commit is contained in:
peah
2015-12-02 08:20:53 -08:00
committed by Commit bot
parent 7e4e01a441
commit de0fc58784

View File

@ -43,6 +43,20 @@
(void) fwrite(data, data_size, 1, file); \
} while (0)
// Dumps a raw scalar int32 to file.
#define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_INT32(file, data) \
do { \
int32_t value_to_store = data; \
(void) fwrite(&value_to_store, sizeof(value_to_store), 1, file); \
} while (0)
// Dumps a raw scalar double to file.
#define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_DOUBLE(file, data) \
do { \
double value_to_store = data; \
(void) fwrite(&value_to_store, sizeof(value_to_store), 1, file); \
} while (0)
// Opens a raw data file for writing using the specified sample rate.
#define RTC_AEC_DEBUG_RAW_OPEN(name, instance_counter, file) \
do { \
@ -73,6 +87,14 @@
do { \
} while (0)
#define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_INT32(file, data) \
do { \
} while (0)
#define RTC_AEC_DEBUG_RAW_WRITE_SCALAR_DOUBLE(file, data) \
do { \
} while (0)
#define RTC_AEC_DEBUG_RAW_OPEN(file, name, instance_counter) \
do { \
} while (0)