add custom raygun logger for VFS

pull/223/head
Fabian Jakobs 2015-11-11 14:51:39 +00:00
rodzic 667b8fddc0
commit ef6ad9c733
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -29,6 +29,11 @@ function plugin(options, imports, register) {
warning: new raygun.Client().init({ apiKey: options.keys.warning })
};
var customClients = options.customClients || {};
for (var client in customClients) {
clients[client] = new raygun.Client().init({ apiKey: customClients[client] });
}
for (var client in clients) {
client = clients[client];
client._send = client.send;
@ -38,11 +43,9 @@ function plugin(options, imports, register) {
return this._send.apply(this, arguments);
};
client.setVersion(options.version + ".0");
}
clients.error.setVersion(options.version + ".0");
clients.warning.setVersion(options.version + ".0");
graceful.on("destroy", function(err) {
if (!err) return graceful.emit("destroyComplete");
console.error(err);
@ -57,6 +60,9 @@ function plugin(options, imports, register) {
Client: clients.error,
errorClient: clients.error,
warningClient: clients.warning,
customClient: function(name) {
return client[name];
},
customData: customData
}
});