js: Don't use global.log*

These are "deprecated", and are just references to the gjs logging functoins

https://bugzilla.gnome.org/show_bug.cgi?id=675790
This commit is contained in:
Jasper St. Pierre 2012-05-09 22:37:42 -03:00
parent 3a01aaf7fb
commit ce041a3190
5 changed files with 11 additions and 10 deletions

View File

@ -210,7 +210,7 @@ const Application = new Lang.Class({
try {
extension = ExtensionUtils.createExtensionObject(uuid, dir, type);
} catch(e) {
global.logError('' + e);
logError(e, 'Could not create extensions object');
return;
}
@ -257,7 +257,7 @@ function initEnvironment() {
},
logError: function(s) {
global.log('ERROR: ' + s);
log('ERROR: ' + s);
},
userdatadir: GLib.build_filenamev([GLib.get_user_data_dir(), 'gnome-shell'])

View File

@ -120,7 +120,7 @@ function createExtensionObject(uuid, dir, type) {
// Encourage people to add this
if (!meta.url) {
global.log('Warning: Missing "url" property in metadata.json');
log('Warning: Missing "url" property in %s/metadata.json'.format(uuid));
}
if (uuid != meta.uuid) {
@ -157,7 +157,7 @@ function init() {
if (!userExtensionsDir.query_exists(null))
userExtensionsDir.make_directory_with_parents(null);
} catch (e) {
global.logError('' + e);
logError(e, 'Could not create extensions directory');
}
}
@ -167,7 +167,7 @@ function scanExtensionsInDirectory(callback, dir, type) {
try {
fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
} catch(e) {
global.logError('' + e);
logError(e, 'Could not enumerate extensions directory');
return;
}

View File

@ -237,7 +237,7 @@ function logExtensionError(uuid, message, state) {
extension.errors = [];
extension.errors.push(message);
global.logError('Extension "%s" had error: %s'.format(uuid, message));
log('Extension "%s" had error: %s'.format(uuid, message));
state = state || ExtensionState.ERROR;
_signals.emit('extension-state-changed', { uuid: uuid,
error: message,
@ -249,7 +249,7 @@ function loadExtension(dir, type, enabled) {
let extension;
if (ExtensionUtils.extensions[uuid] != undefined) {
global.logError('Extension "%s" is already loaded'.format(uuid));
log('Extension "%s" is already loaded'.format(uuid));
return;
}

View File

@ -875,7 +875,8 @@ function initializeDeferredWork(actor, callback, props) {
function queueDeferredWork(workId) {
let data = _deferredWorkData[workId];
if (!data) {
global.logError('invalid work id ', workId);
let message = 'Invalid work id %d'.format(workId);
logError(new Error(message), message);
return;
}
if (_deferredWorkQueue.indexOf(workId) < 0)

View File

@ -354,7 +354,7 @@ const SearchSystem = new Lang.Class({
results.push([provider, []]);
provider.getSubsearchResultSet(previousResults, terms);
} catch (error) {
global.log ('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message);
log('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message);
}
}
} else {
@ -364,7 +364,7 @@ const SearchSystem = new Lang.Class({
results.push([provider, []]);
provider.getInitialResultSet(terms);
} catch (error) {
global.log ('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message);
log('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message);
}
}
}