|
3 | 3 | const CONFIG_DEFAULT_HOST = 'https://phabricator.example.com/api/'; |
4 | 4 | const CONFIG_DEFAULT_TOKEN = 'api-XYZ'; |
5 | 5 |
|
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 | | - |
19 | 6 | function rangeToString(range) { |
20 | 7 | if (range.start.row === range.end.row) { |
21 | 8 | return range.start.row + 1; |
@@ -125,7 +112,7 @@ export default { |
125 | 112 | this.conduitFactory() |
126 | 113 | .then((canduit) => { |
127 | 114 | this.canduit = canduit; |
128 | | - console.info(`Successfully connected to diffusion.`); |
| 115 | + console.info(`[open-in-diffusion] Successfully connected to diffusion.`); |
129 | 116 | this.provider && this.provider.remove(connectingMessage); |
130 | 117 | }); |
131 | 118 | }, |
@@ -226,7 +213,7 @@ export default { |
226 | 213 | this.provider && this.provider.remove(connectingMessage); |
227 | 214 | }) |
228 | 215 | .catch((message) => { |
229 | | - console.warn(`Unable to open ${nuclideFilePath}. ${message}`); |
| 216 | + console.warn(`[open-in-diffusion] Unable to open ${nuclideFilePath}. ${message}`); |
230 | 217 | this.provider && this.provider.remove(connectingMessage); |
231 | 218 | const errorMessage = `Unable to open ${nuclideFilePath}`; |
232 | 219 | this.provider && this.provider.add(errorMessage); |
|
0 commit comments