Can I use `<http://pulumi.log.info|pulumi.log.info...
# typescript
l
Can I use
<http://pulumi.log.info|pulumi.log.info>(...)
during
preview
operations? I want to debug
ResourceTransformation
callback functions.
g
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
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
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
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
Relevant