Use backup channels when spdlog fails and log telemetry

This commit is contained in:
Sandeep Somavarapu
2018-09-06 07:46:40 +02:00
parent 03a8c0c05d
commit dc4c763127
3 changed files with 171 additions and 21 deletions

View File

@@ -111,7 +111,17 @@ export class ExtHostOutputService {
if (!name) {
throw new Error('illegal argument `name`. must not be falsy');
} else {
return push ? new ExtHostPushOutputChannel(name, this._proxy) : new ExtHostFileOutputChannel(name, this._outputDir, this._proxy);
if (push) {
return new ExtHostPushOutputChannel(name, this._proxy);
} else {
// Do not crash if logger cannot be created
try {
return new ExtHostFileOutputChannel(name, this._outputDir, this._proxy);
} catch (error) {
console.log(error);
return new ExtHostPushOutputChannel(name, this._proxy);
}
}
}
}
}