From: OpenOCD-Gerrit <ope...@us...> - 2021-11-13 10:52:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a4f8bf7a9041eb37cf5b8df441935664809f13ac (commit) from e9a569aa18230766ae0bb6dd1a6dc843eb8c087b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a4f8bf7a9041eb37cf5b8df441935664809f13ac Author: Jan Matyas <ma...@co...> Date: Mon Nov 1 15:28:28 2021 +0100 helper/log: Add macros for target-related errors/warnings/... This commit introduces macros for target related log entries (error, warning, ...) which is a very common operation in OpenOCD: * LOG_TARGET_ERROR * LOG_TARGET_WARNING * LOG_TARGET_INFO * LOG_TARGET_DEBUG * LOG_TARGET_DEBUG_IO The goal is to have one macro for this common operation and to make such log entries look the same way - to make it more readable for humans as well easier for parsing via scripts. Change-Id: I6166565fc9040b03d3fca5c3aa44a1ccbcf96ad2 Signed-off-by: Jan Matyas <ma...@co...> Reviewed-on: https://review.openocd.org/c/openocd/+/6667 Tested-by: jenkins Reviewed-by: Tim Newsome <ti...@si...> Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/log.h b/src/helper/log.h index 34ff835b8..621d467b4 100644 --- a/src/helper/log.h +++ b/src/helper/log.h @@ -143,6 +143,23 @@ extern int debug_level; #define LOG_OUTPUT(expr ...) \ log_printf(LOG_LVL_OUTPUT, __FILE__, __LINE__, __func__, expr) +/* Output a log entry that is related to a given target */ + +#define LOG_TARGET_DEBUG_IO(target, fmt_str, ...) \ + LOG_DEBUG_IO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) + +#define LOG_TARGET_DEBUG(target, fmt_str, ...) \ + LOG_DEBUG("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) + +#define LOG_TARGET_INFO(target, fmt_str, ...) \ + LOG_INFO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) + +#define LOG_TARGET_WARNING(target, fmt_str, ...) \ + LOG_WARNING("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) + +#define LOG_TARGET_ERROR(target, fmt_str, ...) \ + LOG_ERROR("[%s] " fmt_str, target_name(target), ##__VA_ARGS__) + /* general failures * error codes < 100 */ ----------------------------------------------------------------------- Summary of changes: src/helper/log.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) hooks/post-receive -- Main OpenOCD repository |