@@ -35,11 +35,6 @@ function makeConsole(tag) {
35
35
}
36
36
const console = makeConsole ( 'SwingSet:controller' ) ;
37
37
38
- // FIXME: Put this somewhere better.
39
- process . on ( 'unhandledRejection' , e =>
40
- console . error ( 'UnhandledPromiseRejectionWarning:' , e ) ,
41
- ) ;
42
-
43
38
const ADMIN_DEVICE_PATH = require . resolve ( './kernel/vatAdmin/vatAdmin-src' ) ;
44
39
const ADMIN_VAT_PATH = require . resolve ( './kernel/vatAdmin/vatAdminWrapper' ) ;
45
40
const KERNEL_SOURCE_PATH = require . resolve ( './kernel/kernel.js' ) ;
@@ -135,10 +130,19 @@ export async function buildVatController(
135
130
argv = [ ] ,
136
131
runtimeOptions = { } ,
137
132
) {
133
+ const { debugPrefix = '' } = runtimeOptions ;
138
134
if ( typeof Compartment === 'undefined' ) {
139
135
throw Error ( 'SES must be installed before calling buildVatController' ) ;
140
136
}
141
137
138
+ // eslint-disable-next-line no-shadow
139
+ const console = makeConsole ( `${ debugPrefix } SwingSet:controller` ) ;
140
+
141
+ // FIXME: Put this somewhere better.
142
+ process . on ( 'unhandledRejection' , e =>
143
+ console . error ( 'UnhandledPromiseRejectionWarning:' , e ) ,
144
+ ) ;
145
+
142
146
// https://github.com/Agoric/SES-shim/issues/292
143
147
harden ( Object . getPrototypeOf ( console ) ) ;
144
148
harden ( console ) ;
@@ -168,7 +172,7 @@ export async function buildVatController(
168
172
const kernelNS = await importBundle ( kernelSource , {
169
173
filePrefix : 'kernel' ,
170
174
endowments : {
171
- console : makeConsole ( ' SwingSet:kernel' ) ,
175
+ console : makeConsole ( ` ${ debugPrefix } SwingSet:kernel` ) ,
172
176
require : kernelRequire ,
173
177
HandledPromise,
174
178
} ,
@@ -203,7 +207,7 @@ export async function buildVatController(
203
207
204
208
function makeVatEndowments ( consoleTag ) {
205
209
return harden ( {
206
- console : makeConsole ( `SwingSet:${ consoleTag } ` ) ,
210
+ console : makeConsole ( `${ debugPrefix } SwingSet:${ consoleTag } ` ) ,
207
211
HandledPromise,
208
212
// re2 is a RegExp work-a-like that disables backtracking expressions for
209
213
// safer memory consumption
0 commit comments