robhogan / react-native-paho-mqtt

react-native-paho-mqtt
91 stars 32 forks source link

How to disable console logs / trace? #8

Closed JulianKingman closed 7 years ago

JulianKingman commented 7 years ago

I get a console log for ever message and action the MQTT client takes, is there a way to disable them? I tried using the traceFunction option and the trace option in the client constructor, but that didn't seem to do anything. I'd expect something like "debug: false"

robhogan commented 7 years ago

There shouldn't be any output unless you've explicitly set a trace function (eg with client._client.traceFunction = console.log or with client.trace = console.log). Are you sure you haven't got some stray debug code somewhere?

JulianKingman commented 7 years ago

Arg, oh my gosh. No, I'm not sure 😳

I had this hidden in my code, I totally forgot I added it: this.client._client.traceFunction = trace => console.log(trace.message);

robhogan commented 7 years ago

That looks familiar! Glad it's not a problem.