Module Integration Guides
...
ESP-IDF
Cloud Logging
5 min
cloud logging is one of the most underrated features when it comes to remote debugging with bytebeam esp idf sdk it is as simple as serial logging let me show you how, configure the log stream to push the log to bytebeam cloud you need to first create a stream you can do this by following the docid\ qlmwlqu6zjj6ena bffhw guide log stream is configured to logs by default inside the sdk and you have the option to tune it as per your choice using bytebeam log stream set function once you have created a stream you can use the logging macros to publish the log to the stream note make sure to add the tag, level and message fields i e (data type is string) while creating the stream // get the log stream name char log stream name = bytebeam log stream get(); // configure the log stream if needed, defaults to "logs" bytebeam log stream set("device logs"); let's send the log to bytebeam cloud we have implemented the cloud logging in esp idf style so if you're familiar with the esp idf logging library, you can easily relate to it // setting logging tag const char tag = "example tag"; // // error log // bytebeam loge(tag, "i am %s log", "error"); // // warn log // bytebeam logw(tag, "i am %s log", "warn"); // // info log // bytebeam logi(tag, "i am %s log", "info"); // // debug log // bytebeam logd(tag, "i am %s log", "debug"); // // verbose log // bytebeam logv(tag, "i am %s log", "verbose"); logging level we support multiple logging level ranging from bytebeam log level none to bytebeam log level verbose and the level of logging you want to achieve in your code can be set by using bytebeam log level set function anywhere in your code when you call any logging macro the sdk will check the configured log level internally and will only log it if the log level is equal or less than the configured log level // get the bytebeam log level int current log level = bytebeam log level get(); // set the bytebeam log level bytebeam log level set(log level to set); enable/disable cloud logging few cases exists where you don't want to pump up the logs to cloud, in those scenarios you can disable the cloud logging using bytebeam disable cloud logging function anywhere in the code by default, cloud logging is enabled inside the sdk // check if cloud logging is enabled or disabled for your device bool cloud logging status = bytebeam is cloud logging enabled(); if(!cloud logging status) { serial println("cloud logging is disabled "); } else { serial println("cloud logging is enabled "); } // enable cloud logging for your device (default) bytebeam enable cloud logging(); // disable cloud logging for your device bytebeam disable cloud logging(); have a look at https //github com/bytebeamio/esp bytebeam sdk/tree/main/examples/cloud logging example app for a full fledged example showing how you can use cloud logging feature to send some crucial information to bytebeam cloud

