FlavorScape
FlavorScape

Reputation: 14309

How to turn off logging for superagent in node.js?

besides monkeypatching console.log and ignoring lines with superagent, is there a way to disable built-in logging in superagent when running in node?

currently, it always logs something like this: superagent GET https://example.com/test?query=blah -> 200 +5ms

I can't find this in the docs.

Upvotes: 0

Views: 812

Answers (1)

Estus Flask
Estus Flask

Reputation: 222750

As many Node packages, superagent uses debug to show debugging information. The problem likely occurs because debugging was enabled for all namespaces (*).

As the documentation explains, if all namespaces are included with a wildcard, some can be excluded:

process.env.DEBUG = '*,-superagent';

Upvotes: 1

Related Questions