mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 17:50:16 +01:00
logging/trivial: rename _nm_log() to _nm_log_impl()
The actual logging implementation is not supposed to be called directly, because there are macros that capture the call site information __FILE__, __LINE__, and G_STRFUNC. Rename the function to make clear that this is the actual implementation.
This commit is contained in:
parent
2458ddf5e9
commit
211d241ab0
3 changed files with 18 additions and 18 deletions
|
|
@ -64,7 +64,7 @@ _slog_level_to_nm (int slevel)
|
|||
if (nm_logging_enabled (_nm_l, LOGD_DHCP)) { \
|
||||
const char *_nm_location = strrchr ((""file), '/'); \
|
||||
\
|
||||
_nm_log (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_DHCP, _nm_e, ("%s"format), "sd-dhcp: ", ## __VA_ARGS__); \
|
||||
_nm_log_impl (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_DHCP, _nm_e, ("%s"format), "sd-dhcp: ", ## __VA_ARGS__); \
|
||||
} \
|
||||
(_nm_e > 0 ? -_nm_e : _nm_e); \
|
||||
})
|
||||
|
|
|
|||
|
|
@ -361,14 +361,14 @@ nm_logging_enabled (NMLogLevel level, NMLogDomain domain)
|
|||
}
|
||||
|
||||
void
|
||||
_nm_log (const char *file,
|
||||
guint line,
|
||||
const char *func,
|
||||
NMLogLevel level,
|
||||
NMLogDomain domain,
|
||||
int error,
|
||||
const char *fmt,
|
||||
...)
|
||||
_nm_log_impl (const char *file,
|
||||
guint line,
|
||||
const char *func,
|
||||
NMLogLevel level,
|
||||
NMLogDomain domain,
|
||||
int error,
|
||||
const char *fmt,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
char *msg;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ typedef enum { /*< skip >*/
|
|||
#define nm_log(level, domain, ...) \
|
||||
G_STMT_START { \
|
||||
if (nm_logging_enabled ((level), (domain))) { \
|
||||
_nm_log (__FILE__, __LINE__, G_STRFUNC, (level), (domain), 0, ""__VA_ARGS__); \
|
||||
_nm_log_impl (__FILE__, __LINE__, G_STRFUNC, (level), (domain), 0, ""__VA_ARGS__); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
|
|
@ -135,14 +135,14 @@ typedef enum { /*< skip >*/
|
|||
nm_log_ptr ((level), (domain), (self), __VA_ARGS__)
|
||||
|
||||
|
||||
void _nm_log (const char *file,
|
||||
guint line,
|
||||
const char *func,
|
||||
NMLogLevel level,
|
||||
NMLogDomain domain,
|
||||
int error,
|
||||
const char *fmt,
|
||||
...) __attribute__((__format__ (__printf__, 7, 8)));
|
||||
void _nm_log_impl (const char *file,
|
||||
guint line,
|
||||
const char *func,
|
||||
NMLogLevel level,
|
||||
NMLogDomain domain,
|
||||
int error,
|
||||
const char *fmt,
|
||||
...) __attribute__((__format__ (__printf__, 7, 8)));
|
||||
|
||||
const char *nm_logging_level_to_string (void);
|
||||
const char *nm_logging_domains_to_string (void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue