https://pulumi.com logo
l

limited-rainbow-51650

09/08/2020, 5:55 PM
Can I use
<http://pulumi.log.info|pulumi.log.info>(...)
during
preview
operations? I want to debug
ResourceTransformation
callback functions.
g

gorgeous-egg-16927

09/08/2020, 5:58 PM
Should be able to. Another approach I like is editing the relevant
.js
file in the node_modules to add logging. Editing the JS files directly is a tighter feedback loop since you don’t have to recompile.
You can also use
console.log
for this
l

limited-rainbow-51650

09/08/2020, 5:59 PM
I tried
console.log
first, but nothing was displayed during
pulumi preview --diff
. Does Pulumi configure the NodeJS runtime with a different log sink?
And I do not need to edit anything in
node_modules
, as the ResourceTransformation is my own code within the Pulumi project
@gorgeous-egg-16927 So if I put
<http://pulumi.log.info|pulumi.log.info>
lines in my code, how can I make the output visible?
g

gorgeous-egg-16927

09/08/2020, 6:05 PM
Does Pulumi configure the NodeJS runtime with a different log sink?
I don’t know for sure. I think I’ve used both in the past. The code gets run during preview, so I’d expect you to see any logging during preview and update
l

limited-rainbow-51650

09/08/2020, 6:16 PM
Found it. There was a bug in my code which result in my transformation not being set on the resource. So my transformation wasn’t invoked at all. 😊
🙂 1
h

hundreds-musician-51496

09/09/2020, 11:09 PM
Relevant