I can’t tell if it’s SST or CDK doing it, but when...
# help
s
I can’t tell if it’s SST or CDK doing it, but when I run
DEBUG=rc:* yarn start
to get debugging messages for my own stuff, I get a fair amount of other debugging messages, because they’re just checking for the existence of
process.env.DEBUG
. (to clarify, I’m using the npm
debug
package which lets you namespace your stuff to get selective debugging messages)
f
yeah, SST internally sets
process.env.DEBUG
when the
--verbose
flag is passed in. I think you are seeing the verbose logs.
s
I wish the
debug
package let you change which env var it reads from
t
Is there a convention of name spacing it in node?
s
yeah. basically:
Copy code
import createDebug from 'debug';

const debug = createDebug('namespace:something');
so then I can do
DEBUG=namespace:* yarn start
the problem is, lots of other applications just look for the presence of
DEBUG
and start spitting stuff out. which is understandable.. heck, I didn’t even know about the debug npm package till today 😄 118 million downloads per week though..whew!
y
i used to think TJ Hollowaychuck (debug author) was a group with how many node modules he published