question

SilverChips avatar image
0 Votes"
SilverChips asked Nandha22 edited

How to disable default trace/log messages of iot hub C++ client

When I run my client I get the following displayed in my console. How can I disable this and make sure its not being written to the standard out

-> 00:50:54 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: xxxxxx/?api-version=2019-10-01&DeviceClientType=iothubclient%2f1.3.9%20(native%3b%20WindowsProduct%3a0x00000008%206.2%3b%20x64%3b%20%7b8DA4D7CC-3ACD-46D1-B068-9635F8587174%7d) | PWD: XXXX | CLEAN: 0
<- 00:50:54 CONNACK | SESSION_PRESENT: true | RETURN_CODE: 0x0
-> 00:50:54 SUBSCRIBE | PACKET_ID: 2 | TOPIC_NAME: $iothub/twin/res/# | QOS: 0 | TOPIC_NAME: $iothub/methods/POST/# | QOS: 0
<- 00:50:54 SUBACK | PACKET_ID: 2 | RETURN_CODE: 0 | RETURN_CODE: 0
-> 00:50:54 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/GET/?$rid=3
-> 00:50:54 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=4 | PAYLOAD_LEN: 1775
<- 00:50:54 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/200/?$rid=3 | PAYLOAD_LEN: 1179
-> 00:50:54 SUBSCRIBE | PACKET_ID: 5 | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/# | QOS: 0
<- 00:50:54 SUBACK | PACKET_ID: 5 | RETURN_CODE: 0

azure-iotazure-iot-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

asergaz avatar image
1 Vote"
asergaz answered SilverChips commented

When you used CMAKE did you turn ON the option no_logging ?

https://github.com/Azure/azure-iot-sdk-c/blob/master/CMakeLists.txt#L70

67459-image.png

Thanks!


image.png (85.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@asergaz no i did not do that. I am using the libraries now in a lot of my code. Is there a way for me to do this programmatically ?

0 Votes 0 ·

Hi SilverChips,
If you recompile and start using those would that not be the solution to your case? Let me know what are the concerns doing it?

Thanks!

0 Votes 0 ·