@@ -176,17 +176,33 @@ export class VMWorkflowCreator implements WorkflowCreator {
176
176
}
177
177
178
178
/**
179
- * Inject console.log into the Workflow isolate context.
179
+ * Inject console.log and friends into the Workflow isolate context.
180
180
*
181
181
* Overridable for test purposes.
182
182
*/
183
183
protected injectConsole ( context : vm . Context , info : WorkflowInfo , ac : ActivationContext ) : void {
184
+ // isReplaying is mutated by the Workflow class on activation
184
185
context . console = {
185
186
log : ( ...args : any [ ] ) => {
186
- // isReplaying is mutated by the Workflow class on activation
187
187
if ( ac . isReplaying ) return ;
188
188
console . log ( `[${ info . workflowType } (${ info . workflowId } )]` , ...args ) ;
189
189
} ,
190
+ error : ( ...args : any [ ] ) => {
191
+ if ( ac . isReplaying ) return ;
192
+ console . error ( `[${ info . workflowType } (${ info . workflowId } )]` , ...args ) ;
193
+ } ,
194
+ warn : ( ...args : any [ ] ) => {
195
+ if ( ac . isReplaying ) return ;
196
+ console . warn ( `[${ info . workflowType } (${ info . workflowId } )]` , ...args ) ;
197
+ } ,
198
+ info : ( ...args : any [ ] ) => {
199
+ if ( ac . isReplaying ) return ;
200
+ console . info ( `[${ info . workflowType } (${ info . workflowId } )]` , ...args ) ;
201
+ } ,
202
+ debug : ( ...args : any [ ] ) => {
203
+ if ( ac . isReplaying ) return ;
204
+ console . debug ( `[${ info . workflowType } (${ info . workflowId } )]` , ...args ) ;
205
+ } ,
190
206
} ;
191
207
}
192
208
0 commit comments