[Mesa-dev] [PATCH 12/23] intel: Add simple logging façade for Android

Chad Versace chadversary at chromium.org
Wed Sep 6 20:22:26 UTC 2017


On Sat 02 Sep 2017, Jason Ekstrand wrote:
> n Sat, Sep 2, 2017 at 1:17 AM, Chad Versace <[1]chadversary at chromium.org>
> wrote:

>     My goal here is not perfection. My goal is to make a minimal, clean API,
>     that people hate merely a little instead of a lot, and that's good
>     enough to let me bring up Android Vulkan.  And it needs to be fast,
>     which means it must be small. No one wants to their game to miss frames
>     while aiming a flaming bow into the jaws of an angry robot t-rex, and
>     thus become t-rex breakfast, because some fool had too much fun desiging
>     a bloated, ideal logging API.
> 
> 
> I don't actually hate it at all. In fact, I rather like it.  Sadtly, we
> probably need a bit more indirection in Vulkan thanks to VK_EXT_debug_report
> but it should be pretty easy to tie in here.
>  
> 
>     If people like it, perhaps we should quickly promote it to src/util.
> 
> 
> I'd be a fan.

Would you rather see this land as-is, then promote? Or promot, then
land?

>     +#define intel_loge(fmt, ...) intel_log(INTEL_LOG_ERROR, (INTEL_LOG_TAG),
>     (fmt), ##__VA_ARGS__)
>     +#define intel_logw(fmt, ...) intel_log(INTEL_LOG_WARN, (INTEL_LOG_TAG),
>     (fmt), ##__VA_ARGS__)
>     +#define intel_logi(fmt, ...) intel_log(INTEL_LOG_INFO, (INTEL_LOG_TAG),
>     (fmt), ##__VA_ARGS__)
>     +#ifdef DEBUG
>     +#define intel_logd(fmt, ...) intel_log(INTEL_LOG_DEBUG, (INTEL_LOG_TAG),
>     (fmt), ##__VA_ARGS__)
>     +#else
>     +#define intel_logd(fmt, ...) __intel_log_use_args((fmt), ##__VA_ARGS__)
>     +#endif
> 
> 
> I'm not sure if ignoring debug loigging is best done here or at some slightly
> higher level.  I think here is probably fine.

I had the same thoughts. I tentatively chose to do it here because
I wanted to keep the patch simple.


More information about the mesa-dev mailing list