boot/efi/log: always include filename, line, and function in log message
Then, drop unused log_trace().
This commit is contained in:
@@ -52,15 +52,6 @@ EFI_STATUS log_internal(EFI_STATUS status, uint8_t text_color, const char *forma
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef EFI_DEBUG
|
||||
void log_hexdump(const char16_t *prefix, const void *data, size_t size) {
|
||||
/* Debugging helper — please keep this around, even if not used */
|
||||
|
||||
_cleanup_free_ char16_t *hex = hexdump(data, size);
|
||||
log_internal(EFI_SUCCESS, EFI_LIGHTRED, "%ls[%zu]: %ls", prefix, size, hex);
|
||||
}
|
||||
#endif
|
||||
|
||||
void log_wait(void) {
|
||||
if (log_count == 0)
|
||||
return;
|
||||
|
||||
+13
-9
@@ -23,13 +23,17 @@ __attribute__((no_stack_protector, noinline)) void __stack_chk_guard_init(void);
|
||||
_noreturn_ void freeze(void);
|
||||
void log_wait(void);
|
||||
_gnu_printf_(3, 4) EFI_STATUS log_internal(EFI_STATUS status, uint8_t text_color, const char *format, ...);
|
||||
#define log_debug(...) log_internal(EFI_SUCCESS, EFI_LIGHTGRAY, __VA_ARGS__)
|
||||
#define log_info(...) log_internal(EFI_SUCCESS, EFI_WHITE, __VA_ARGS__)
|
||||
#define log_error_status(status, ...) log_internal(status, EFI_LIGHTRED, __VA_ARGS__)
|
||||
#define log_error(...) log_internal(EFI_INVALID_PARAMETER, EFI_LIGHTRED, __VA_ARGS__)
|
||||
#define log_oom() log_internal(EFI_OUT_OF_RESOURCES, EFI_LIGHTRED, "Out of memory.")
|
||||
#define log_trace() log_internal(EFI_SUCCESS, EFI_LIGHTRED, "%s:%i@%s", __FILE__, __LINE__, __func__)
|
||||
#define log_full(status, text_color, format, ...) \
|
||||
log_internal(status, text_color, "%s:%i@%s: " format, __FILE__, __LINE__, __func__, ##__VA_ARGS__)
|
||||
#define log_debug(...) log_full(EFI_SUCCESS, EFI_LIGHTGRAY, __VA_ARGS__)
|
||||
#define log_info(...) log_full(EFI_SUCCESS, EFI_WHITE, __VA_ARGS__)
|
||||
#define log_error_status(status, ...) log_full(status, EFI_LIGHTRED, __VA_ARGS__)
|
||||
#define log_error(...) log_full(EFI_INVALID_PARAMETER, EFI_LIGHTRED, __VA_ARGS__)
|
||||
#define log_oom() log_full(EFI_OUT_OF_RESOURCES, EFI_LIGHTRED, "Out of memory.")
|
||||
|
||||
#ifdef EFI_DEBUG
|
||||
void log_hexdump(const char16_t *prefix, const void *data, size_t size);
|
||||
#endif
|
||||
/* Debugging helper — please keep this around, even if not used */
|
||||
#define log_hexdump(prefix, data, size) \
|
||||
({ \
|
||||
_cleanup_free_ char16_t *hex = hexdump(data, size); \
|
||||
log_debug("%ls[%zu]: %ls", prefix, size, hex); \
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user