Make it possible to set log file

And use stdout for CC3200 demo because
  (1) an apparent bug which causes output sent to stderr to be
      printed v-e-r-y s-l-o-w-l-y (yes, it is really like that;
      https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/501881)
  (2) in CCS it is printed in BLOOD RED, which is annoying

PUBLISHED_FROM=36a86744bc8ea193e99e98670dadc7f3ab6ed53e
This commit is contained in:
Deomid Ryabkov authored and rojer committed 2016-04-01 03:14:29 +01:00
1 parent c9fc7a1320
commit fb53cd37e7
3 files changed
+32 -20

No files matched your search

+12 -12
View File
@@ -637,29 +637,29 @@ enum cs_log_level {
_LL_MAX = 5,
};
extern enum cs_log_level s_cs_log_level;
void cs_log_set_level(enum cs_log_level level);
#ifndef CS_DISABLE_STDIO
#ifdef CS_LOG_TS_DIFF
extern double cs_log_ts;
#endif
#include <stdio.h>
void cs_log_set_file(FILE *file);
extern enum cs_log_level cs_log_level;
void cs_log_printf(const char *fmt, ...);
#define LOG(l, x) \
if (s_cs_log_level >= l) { \
fprintf(stderr, "%-20s ", __func__); \
cs_log_printf x; \
#define LOG(l, x) \
if (cs_log_level >= l) { \
cs_log_printf("%-20s ", __func__); \
cs_log_printf x; \
}
#ifndef CS_NDEBUG
#define DBG(x) \
if (s_cs_log_level >= LL_VERBOSE_DEBUG) { \
fprintf(stderr, "%-20s ", __func__); \
cs_log_printf x; \
#define DBG(x) \
if (cs_log_level >= LL_VERBOSE_DEBUG) { \
cs_log_printf("%-20s ", __func__); \
cs_log_printf x; \
}
#else /* NDEBUG */