summaryrefslogtreecommitdiff
path: root/src/helper/log.h
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-28 08:11:18 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-28 08:11:18 +0000
commit0689e3dd6752f45f493eceb3edf040fbc7849846 (patch)
tree57c2d288e4ea01551e0ea7806957cd1f5a2165dc /src/helper/log.h
parentb70e262867b724f7d265f0c6b206801a29ba284b (diff)
downloadopenocd+libswd-0689e3dd6752f45f493eceb3edf040fbc7849846.tar.gz
openocd+libswd-0689e3dd6752f45f493eceb3edf040fbc7849846.tar.bz2
openocd+libswd-0689e3dd6752f45f493eceb3edf040fbc7849846.tar.xz
openocd+libswd-0689e3dd6752f45f493eceb3edf040fbc7849846.zip
- Added TARGET_REQ_DEBUGCHAR target_request debugmsg. This
provides a better impeadance match for debug output char fn's, e.g. eCos. - Line endings are now added at the caller site of command_print*(). command_print() still adds a line ending - echo of commands in scripts are now available via debug_level instead of forced echo - Added a USER_SAMELINE() for printing without a lineend. git-svn-id: svn://svn.berlios.de/openocd/trunk@364 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper/log.h')
-rw-r--r--src/helper/log.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/helper/log.h b/src/helper/log.h
index 6c7c3de6..48b43d8e 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -46,7 +46,10 @@ enum log_levels
extern void log_printf(enum log_levels level, const char *file, int line,
const char *function, const char *format, ...)
- __attribute__ ((format (printf, 5, 6)));
+__attribute__ ((format (printf, 5, 6)));
+extern void log_printfnl(enum log_levels level, const char *file, int line,
+ const char *function, const char *format, ...)
+__attribute__ ((format (printf, 5, 6)));
extern int log_register_commands(struct command_context_s *cmd_ctx);
extern int log_init(struct command_context_s *cmd_ctx);
extern int set_log_output(struct command_context_s *cmd_ctx, FILE *output);
@@ -71,34 +74,40 @@ extern int debug_level;
/* Avoid fn call and building parameter list if we're not outputting the information.
* Matters on feeble CPUs for DEBUG/INFO statements that are involved frequently */
+
#define DEBUG(expr ...) \
do { if (debug_level >= LOG_DEBUG) \
- log_printf (LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, expr); \
+ log_printfnl (LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)
#define INFO(expr ...) \
do { if (debug_level >= LOG_INFO) \
- log_printf (LOG_INFO, __FILE__, __LINE__, __FUNCTION__, expr); \
+ log_printfnl (LOG_INFO, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)
#define WARNING(expr ...) \
do { \
- log_printf (LOG_WARNING, __FILE__, __LINE__, __FUNCTION__, expr); \
+ log_printfnl (LOG_WARNING, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)
#define ERROR(expr ...) \
do { \
- log_printf (LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, expr); \
+ log_printfnl (LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)
#define USER(expr ...) \
do { \
+ log_printfnl (LOG_USER, __FILE__, __LINE__, __FUNCTION__, expr); \
+ } while(0)
+
+#define USER_SAMELINE(expr ...) \
+ do { \
log_printf (LOG_USER, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)
#define OUTPUT(expr ...) \
do { \
- log_printf (LOG_OUTPUT, __FILE__, __LINE__, __FUNCTION__, expr); \
+ log_printfnl (LOG_OUTPUT, __FILE__, __LINE__, __FUNCTION__, expr); \
} while(0)