Make some of the error logs more informative

Print the X error causing the error as well.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2020-03-28 00:15:45 +00:00
parent 58582eb639
commit 23068c300c
3 changed files with 32 additions and 31 deletions

View File

@@ -73,6 +73,11 @@ struct xvisual_info {
__r; \
})
#define log_error_x_error(e, fmt, ...) \
LOG(ERROR, fmt " (%s)", ##__VA_ARGS__, x_strerror(e))
#define log_fatal_x_error(e, fmt, ...) \
LOG(FATAL, fmt " (%s)", ##__VA_ARGS__, x_strerror(e))
/// Wraps x_new_id. abort the program if x_new_id returns error
static inline uint32_t x_new_id(xcb_connection_t *c) {
auto ret = xcb_generate_id(c);