mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-26 17:37:34 +00:00
u/logging: add U_LOG_XDEV_UNSUPPORTED_INPUT macro
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2271>
This commit is contained in:
parent
e113b532b6
commit
d13a36beec
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2020, Collabora, Ltd.
|
||||
// Copyright 2020-2024, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
* @brief Basic logging functionality.
|
||||
* @author Jakob Bornecrantz <jakob@collabora.com>
|
||||
* @author Simon Zeni <simon.zeni@collabora.com>
|
||||
* @ingroup aux_log
|
||||
*/
|
||||
|
||||
|
@ -12,6 +13,8 @@
|
|||
|
||||
#include "xrt/xrt_compiler.h"
|
||||
|
||||
#include "util/u_pretty_print.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
|
@ -371,6 +374,27 @@ u_log_set_sink(u_log_sink_func_t func, void *data);
|
|||
* @}
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @name Device-related error logging macros
|
||||
*
|
||||
* These are printed from a driver at error level.
|
||||
*
|
||||
* @param xdev The @ref xrt_device pointer associated with this message
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define U_LOG_XDEV_UNSUPPORTED_INPUT(xdev, cond_level, name) \
|
||||
do { \
|
||||
struct u_pp_sink_stack_only sink; \
|
||||
u_pp_delegate_t dg = u_pp_sink_stack_only_init(&sink); \
|
||||
u_pp_xrt_input_name(dg, name); \
|
||||
U_LOG_XDEV_IFL_E(xdev, cond_level, "Unsupported input: %s", sink.buffer); \
|
||||
} while (false);
|
||||
|
||||
/*!
|
||||
* @}
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @name Device-related logging macros that always log.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue