[gnome-shell] environment: Allow window.log to take multiple arguments



commit 32107ba8b5c5756e4ffa05ef8acce8f60ca5994b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Apr 29 16:41:08 2012 -0400

    environment: Allow window.log to take multiple arguments
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675104

 js/ui/environment.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 435eed1..fc3992a 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -39,11 +39,19 @@ function _patchContainerClass(containerClass) {
     };
 }
 
+function _makeLoggingFunc(func) {
+    return function() {
+        return func([].join.call(arguments, ', '));
+    };
+}
+
 function init() {
     // Add some bindings to the global JS namespace; (gjs keeps the web
     // browser convention of having that namespace be called 'window'.)
     window.global = Shell.Global.get();
 
+    window.log = _makeLoggingFunc(window.log);
+
     window._ = Gettext.gettext;
     window.C_ = Gettext.pgettext;
     window.ngettext = Gettext.ngettext;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]