Don't log non-enabled levels from Geary.Logging.Source

We want to do this in the future, but only when we have better means
of selecting which log messages to display or not.
This commit is contained in:
Michael Gratton 2019-12-02 18:21:21 +08:00
parent 24a0ad70ae
commit d949a8e500

View file

@ -217,14 +217,16 @@ public interface Geary.Logging.Source : GLib.Object {
GLib.LogLevelFlags levels,
string fmt,
va_list args) {
Context context = Context(Logging.DOMAIN, flags, levels, fmt, args);
Source? decorated = this;
while (decorated != null) {
context.append_source(decorated);
decorated = decorated.logging_parent;
}
if (flags == ALL || Logging.get_flags().is_any_set(flags)) {
Context context = Context(Logging.DOMAIN, flags, levels, fmt, args);
Source? decorated = this;
while (decorated != null) {
context.append_source(decorated);
decorated = decorated.logging_parent;
}
GLib.log_structured_array(levels, context.to_array());
GLib.log_structured_array(levels, context.to_array());
}
}
}