From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ v4 1/9] log: Don't log __FILE__ and __func__ with DBG_IDX
Date: Fri, 25 Mar 2022 15:57:05 +0100 [thread overview]
Message-ID: <19D73FF4-059E-46D5-9FFA-570DEF6E960A@holtmann.org> (raw)
In-Reply-To: <20220323224003.3736525-2-luiz.dentz@gmail.com>
Hi Luiz,
> This removes __FILE__ and __func__ from DBG_IDX since users of it may
> already contain such information embedded in the format.
> ---
> src/log.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/log.h b/src/log.h
> index 74941beb2..1ed742a0d 100644
> --- a/src/log.h
> +++ b/src/log.h
> @@ -9,6 +9,7 @@
> */
>
> #include <stdint.h>
> +#include <stdbool.h>
seems to have nothing to do with the change here.
> void info(const char *format, ...) __attribute__((format(printf, 1, 2)));
>
> @@ -52,10 +53,11 @@ void __btd_enable_debug(struct btd_debug_desc *start,
> .file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
> }; \
> if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
> - btd_debug(idx, "%s:%s() " fmt, __FILE__, __func__ , ## arg); \
> + btd_debug(idx, fmt, ## arg); \
> } while (0)
>
> -#define DBG(fmt, arg...) DBG_IDX(0xffff, fmt, ## arg)
> +#define DBG(fmt, arg...) \
> + DBG_IDX(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg)
> #define error(fmt, arg...) \
> btd_error(0xffff, "%s:%s() " fmt, __FILE__, __func__, ## arg)
> #define warn(fmt, arg...) \
I am still failing to see why this is better.
Regards
Marcel
next prev parent reply other threads:[~2022-03-25 14:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 22:39 [RFC BlueZ] adapter: Introduce BTD_ADAPTER_DBG Luiz Augusto von Dentz
2022-03-23 22:39 ` [PATCH BlueZ v4 1/9] log: Don't log __FILE__ and __func__ with DBG_IDX Luiz Augusto von Dentz
2022-03-23 23:39 ` [BlueZ,v4,1/9] " bluez.test.bot
2022-03-24 20:11 ` Luiz Augusto von Dentz
2022-03-24 19:50 ` [PATCH BlueZ v4 1/9] " patchwork-bot+bluetooth
2022-03-25 14:57 ` Marcel Holtmann [this message]
2022-03-23 22:39 ` [PATCH BlueZ v4 2/9] mgmt: Add DBG macro Luiz Augusto von Dentz
2022-03-23 22:39 ` [PATCH BlueZ v4 3/9] mgmt: Introduce mgmt_set_verbose Luiz Augusto von Dentz
2022-03-25 15:00 ` Marcel Holtmann
2022-03-23 22:39 ` [PATCH BlueZ v4 4/9] adapter: Don't use DBG in mgmt_debug Luiz Augusto von Dentz
2022-03-25 15:04 ` Marcel Holtmann
2022-03-23 22:39 ` [PATCH BlueZ v4 5/9] att: Log file and function names Luiz Augusto von Dentz
2022-03-23 22:40 ` [PATCH BlueZ v4 6/9] gatt-client: Add DBG macro Luiz Augusto von Dentz
2022-03-23 22:40 ` [PATCH BlueZ v4 7/9] gatt-server: " Luiz Augusto von Dentz
2022-03-23 22:40 ` [PATCH BlueZ v4 8/9] att: Rename att_debug and att_verbose to DBG and VERBOSE Luiz Augusto von Dentz
2022-03-23 22:40 ` [PATCH BlueZ v4 9/9] device: Don't use DBG in gatt_debug Luiz Augusto von Dentz
2022-03-24 2:49 ` [RFC,BlueZ] adapter: Introduce BTD_ADAPTER_DBG bluez.test.bot
2022-03-24 19:50 ` [RFC BlueZ] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19D73FF4-059E-46D5-9FFA-570DEF6E960A@holtmann.org \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox