diff options
| author | Thomas Haller <thaller@redhat.com> | 2014-12-17 09:30:35 +0100 |
|---|---|---|
| committer | Thomas Haller <thaller@redhat.com> | 2014-12-18 17:36:57 +0100 |
| commit | e62aa4165f79a1b42a3c19258284bb945cdaf148 (patch) | |
| tree | d42915d6d7f29d0d670b955a74b9a28683006970 /src/nm-logging.h | |
| parent | 3ea9169c81805885fcc0d2527bfd856de3a0ecc0 (diff) | |
| download | NetworkManager-e62aa4165f79a1b42a3c19258284bb945cdaf148.tar.gz | |
logging: pass file:line as separate arguments to _nm_log()
Previously, we would only pass one argument @loc to _nm_log()
which was set to G_STRLOC.
That has the disadvantage, that for every logging line the binary
contains an individual string __FILE__:__LINE__.
By splitting up @loc into @file and @line, we reduce the number
of strings in the NetworkManager binary by about 50k.
https://bugzilla.gnome.org/show_bug.cgi?id=741651
Diffstat (limited to 'src/nm-logging.h')
| -rw-r--r-- | src/nm-logging.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nm-logging.h b/src/nm-logging.h index 60ddb1e511..4ab2db3ad5 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -105,7 +105,7 @@ typedef enum { /*< skip >*/ #define nm_log(level, domain, ...) \ G_STMT_START { \ if (nm_logging_enabled ((level), (domain))) { \ - _nm_log (G_STRLOC, G_STRFUNC, (level), (domain), __VA_ARGS__); \ + _nm_log (__FILE__, __LINE__, G_STRFUNC, (level), (domain), __VA_ARGS__); \ } \ } G_STMT_END @@ -134,12 +134,13 @@ typedef enum { /*< skip >*/ nm_log_ptr ((level), (domain), (self), __VA_ARGS__) -void _nm_log (const char *loc, +void _nm_log (const char *file, + guint line, const char *func, NMLogLevel level, NMLogDomain domain, const char *fmt, - ...) __attribute__((__format__ (__printf__, 5, 6))); + ...) __attribute__((__format__ (__printf__, 6, 7))); const char *nm_logging_level_to_string (void); const char *nm_logging_domains_to_string (void); |
