log: allow querying whether personal info should be shown or not

We need this when building printable representations of helper types
like the MMBearerProperties object.
This commit is contained in:
Aleksander Morgado
2022-09-13 12:27:13 +00:00
parent 3592d98e5b
commit e6dcebf999
2 changed files with 18 additions and 11 deletions

View File

@@ -213,6 +213,12 @@ log_backend_systemd_journal (const char *loc,
} }
#endif #endif
gboolean
mm_log_get_show_personal_info (void)
{
return personal_info;
}
gboolean gboolean
mm_log_check_level_enabled (MMLogLevel level) mm_log_check_level_enabled (MMLogLevel level)
{ {

View File

@@ -64,17 +64,18 @@ void _mm_log (gpointer obj,
const gchar *fmt, const gchar *fmt,
...) __attribute__((__format__ (__printf__, 6, 7))); ...) __attribute__((__format__ (__printf__, 6, 7)));
gboolean mm_log_set_level (const gchar *level, gboolean mm_log_set_level (const gchar *level,
GError **error); GError **error);
gboolean mm_log_setup (const gchar *level, gboolean mm_log_setup (const gchar *level,
const gchar *log_file, const gchar *log_file,
gboolean log_journal, gboolean log_journal,
gboolean show_ts, gboolean show_ts,
gboolean rel_ts, gboolean rel_ts,
gboolean show_personal_info, gboolean show_personal_info,
GError **error); GError **error);
gboolean mm_log_check_level_enabled (MMLogLevel level); gboolean mm_log_check_level_enabled (MMLogLevel level);
void mm_log_shutdown (void); gboolean mm_log_get_show_personal_info (void);
void mm_log_shutdown (void);
/* Helper used when printing a string that may be personal /* Helper used when printing a string that may be personal
* info. Depending on the settings, we may print it as-is, * info. Depending on the settings, we may print it as-is,