diff --git a/configure.ac b/configure.ac index 7d47643f5..b436a8652 100644 --- a/configure.ac +++ b/configure.ac @@ -77,7 +77,7 @@ AC_MSG_RESULT($enable_systemd) CLUTTER_MIN_VERSION=1.21.5 GOBJECT_INTROSPECTION_MIN_VERSION=1.49.1 -GJS_MIN_VERSION=1.39.0 +GJS_MIN_VERSION=1.47.0 MUTTER_MIN_VERSION=3.22.1 GTK_MIN_VERSION=3.15.0 GIO_MIN_VERSION=2.45.3 diff --git a/js/ui/environment.js b/js/ui/environment.js index 6fb23e353..68ddaa783 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -61,10 +61,19 @@ function _patchLayoutClass(layoutClass, styleProps) { }; } -function _makeLoggingFunc(func) { - return function() { - return func([].join.call(arguments, ', ')); - }; +function _loggingFunc() { + let fields = {'MESSAGE': [].join.call(arguments, ', ')}; + let domain = "GNOME Shell"; + + // If the caller is an extension, add it as metadata + let extension = imports.misc.extensionUtils.getCurrentExtension(); + if (extension != null) { + domain = extension.metadata.name; + fields['GNOME_SHELL_EXTENSION_UUID'] = extension.uuid; + fields['GNOME_SHELL_EXTENSION_NAME'] = extension.metadata.name; + } + + GLib.log_structured(domain, GLib.LogLevelFlags.LEVEL_MESSAGE, fields); } function init() { @@ -72,7 +81,7 @@ function init() { // browser convention of having that namespace be called 'window'.) window.global = Shell.Global.get(); - window.log = _makeLoggingFunc(window.log); + window.log = _loggingFunc; window._ = Gettext.gettext; window.C_ = Gettext.pgettext;