kopia lustrzana https://github.com/c9/core
add custom raygun logger for VFS
rodzic
667b8fddc0
commit
ef6ad9c733
|
@ -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
|
||||
}
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue