aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.96k stars 617 forks source link

Anyway to log the command actually running? #825

Open tommyc38 opened 3 years ago

tommyc38 commented 3 years ago

It's pretty tough to see where you are going wrong with more complex commands without being able to see the actual command being executed. I read the docs but didn't see anything.

tommyc38 commented 3 years ago

I went through the gm packing in my node_modules/gm/lib/command.js and put a console.log(cmd) in the _spawn function to see what was going on. If anyone has a better alternative, please let me know!

p-kuen commented 3 years ago

gm uses the debug package. So you can run your app with the environment variable DEBUG=gm for debug outputs.

So just run DEBUG=gm node src/main.js

tommyc38 commented 3 years ago

@p-kuen, this doesn't work. I have verified the variable is set prior to bootstrapping my node program. Are you sure this is correct? I verified this a number of ways and even ran console.log(process.env) by editing the node_module/gm/lib/command.js script. Everywhere showed DEBUG=gm was set yet nothing was logged.

p-kuen commented 3 years ago

Pretty sure, yes. On which OS do you run the command?

tommyc38 commented 3 years ago

I am using OSx Big Sur