dns: avoid printing pointer value for NMDnsManager logging statements
We avoid printing raw pointer values. Also, in this case this is a singleton, and we only create one instance of this type. Note that we would still have printed the pointer instance while constructing the instances, before setting it as singleton. Just drop this.
This commit is contained in:
@@ -137,28 +137,23 @@ NM_DEFINE_SINGLETON_GETTER(NMDnsManager, nm_dns_manager_get, NM_TYPE_DNS_MANAGER
|
|||||||
|
|
||||||
#define _NMLOG_PREFIX_NAME "dns-mgr"
|
#define _NMLOG_PREFIX_NAME "dns-mgr"
|
||||||
#define _NMLOG_DOMAIN LOGD_DNS
|
#define _NMLOG_DOMAIN LOGD_DNS
|
||||||
#define _NMLOG(level, ...) \
|
#define _NMLOG(level, ...) \
|
||||||
G_STMT_START \
|
G_STMT_START \
|
||||||
{ \
|
{ \
|
||||||
const NMLogLevel __level = (level); \
|
const NMLogLevel __level = (level); \
|
||||||
\
|
\
|
||||||
if (nm_logging_enabled(__level, _NMLOG_DOMAIN)) { \
|
if (nm_logging_enabled(__level, _NMLOG_DOMAIN)) { \
|
||||||
char __prefix[20]; \
|
_nm_unused const NMDnsManager *const __self = (self); \
|
||||||
const NMDnsManager *const __self = (self); \
|
\
|
||||||
\
|
_nm_log(__level, \
|
||||||
_nm_log(__level, \
|
_NMLOG_DOMAIN, \
|
||||||
_NMLOG_DOMAIN, \
|
0, \
|
||||||
0, \
|
NULL, \
|
||||||
NULL, \
|
NULL, \
|
||||||
NULL, \
|
"%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
|
||||||
"%s%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
|
_NMLOG_PREFIX_NAME _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
|
||||||
_NMLOG_PREFIX_NAME, \
|
} \
|
||||||
((!__self || __self == singleton_instance) \
|
} \
|
||||||
? "" \
|
|
||||||
: nm_sprintf_buf(__prefix, "[%p]", __self)) \
|
|
||||||
_NM_UTILS_MACRO_REST(__VA_ARGS__)); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
G_STMT_END
|
G_STMT_END
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user