log: add log_error_errno

Prints error message with strerror(errno) attached, for convenience.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2020-02-26 20:16:55 +00:00
parent 49d620de4f
commit 630d6f3a26
2 changed files with 9 additions and 9 deletions

View File

@@ -37,6 +37,8 @@ enum log_level {
#define log_error(x, ...) LOG(ERROR, x, ##__VA_ARGS__)
#define log_fatal(x, ...) LOG(FATAL, x, ##__VA_ARGS__)
#define log_error_errno(x, ...) LOG(ERROR, x ": %s", ##__VA_ARGS__, strerror(errno))
struct log;
struct log_target;