Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 28d347b

Browse files
committed
Stop clobbering global methods
1 parent fc3a6cf commit 28d347b

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

index.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
const CONFIG_DEFAULT_HOST = 'https://phabricator.example.com/api/';
44
const CONFIG_DEFAULT_TOKEN = 'api-XYZ';
55

6-
function prefix(fn, start) {
7-
const ctx = this;
8-
return function(message) {
9-
fn.call(ctx, start + message);
10-
}
11-
}
12-
13-
console.debug = prefix(console.debug, '[open-in-diffusion] ');
14-
console.error = prefix(console.error, '[open-in-diffusion] ');
15-
console.info = prefix(console.info, '[open-in-diffusion] ');
16-
console.log = prefix(console.log, '[open-in-diffusion] ');
17-
console.warn = prefix(console.warn, '[open-in-diffusion] ');
18-
196
function rangeToString(range) {
207
if (range.start.row === range.end.row) {
218
return range.start.row + 1;
@@ -125,7 +112,7 @@ export default {
125112
this.conduitFactory()
126113
.then((canduit) => {
127114
this.canduit = canduit;
128-
console.info(`Successfully connected to diffusion.`);
115+
console.info(`[open-in-diffusion] Successfully connected to diffusion.`);
129116
this.provider && this.provider.remove(connectingMessage);
130117
});
131118
},
@@ -226,7 +213,7 @@ export default {
226213
this.provider && this.provider.remove(connectingMessage);
227214
})
228215
.catch((message) => {
229-
console.warn(`Unable to open ${nuclideFilePath}. ${message}`);
216+
console.warn(`[open-in-diffusion] Unable to open ${nuclideFilePath}. ${message}`);
230217
this.provider && this.provider.remove(connectingMessage);
231218
const errorMessage = `Unable to open ${nuclideFilePath}`;
232219
this.provider && this.provider.add(errorMessage);

0 commit comments

Comments
 (0)