Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) How to set CONFIG_LOG_DEFAULT_LEVEL (Read 6336 times)
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
How to set CONFIG_LOG_DEFAULT_LEVEL
Nov 19th, 2017 at 5:41pm
Print Post  
Currently developing for esp32 and using ardunio core for esp32 within visual micro. In arduinio ide , menuconfig is used to set this parameter. How do I set it within visual micro. I have tried numerous ways including changing it in the sdkconfig file but it doesn't seem to work. Any help appreciated
  
Back to top
 
IP Logged
 
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #1 - Nov 19th, 2017 at 9:27pm
Print Post  
Now I'm really confused.  I got it working by calling esp_log_level_set at runtime. I also figured out I could get it working by changing the value of config_log_default in the sdkconfig.h file which also works and doing a clean build. However, I was wanting to know how to do this at compile time. So I wrote a little stub using the logging library to try and see what the issue was. And I can't get this to print out anything. Strange. Peeking at the definition of esp_logv, I eventually see that the code checks a define called CORE_DEBUG_LEVEL and since this is set to 0 nothing gets printed. I can't find a way to set this.

How do you set CORE_DEBUG_LEVEL that gets generated in Visual Micro? All very strange. This should be so simple to use.



static const char* TAG = "MyModule";

void setup()
{
     Serial.begin(115200);
     Serial.println("setup");
  /* add setup code here */

     esp_log_level_set("*", ESP_LOG_VERBOSE);
     ESP_LOGV(TAG, "Verbose \n");
     ESP_LOGW(TAG, "Warning \n");
     ESP_LOGI(TAG, "Info \n");
     ESP_LOGE(TAG, "Error \n");
     ESP_LOGD(TAG, "Debug \n");
}

void loop()
{

}
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #2 - Nov 20th, 2017 at 12:35pm
Print Post  
You can add defines an extra build flags in the visual micro project properties.
  
Back to top
WWW  
IP Logged
 
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #3 - Nov 20th, 2017 at 4:18pm
Print Post  
Yes, I saw that and tried it also but not working. I added core_debug_level=5 as a define and it generates it but it also generates the original core_debug_level=0 a few lines later that negates it!. So its picking the value up from somewhere.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #4 - Nov 21st, 2017 at 12:05pm
Print Post  
I suspect it is in the build definition.

Switch on vmicro>verbose and then build. You can see if the define is included in the build command. If you also switch on the "show build properties" option then we will see the build definition and understand how to add the define.
  
Back to top
WWW  
IP Logged
 
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #5 - Nov 21st, 2017 at 4:53pm
Print Post  
attached I the build log and the generated file during compilation. If you open the generated file that gets compiled you will see the two defines for core_debug_level. One is 5 and one is still 0.
« Last Edit: Nov 21st, 2017 at 4:54pm by iain frew »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #6 - Nov 21st, 2017 at 4:57pm
Print Post  
erm, you just sent the code. I need the verbose output that I asked for.

What I can say is that the code you see is deduced for intellisense from the build definition.

So the board definition has the hard coded debug level and that is being passed to all build methods

Please provide verbose output as requested

  
Back to top
WWW  
IP Logged
 
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #7 - Nov 21st, 2017 at 5:04pm
Print Post  
I re added it to the previous message.. but here it is again..thanks!
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #8 - Nov 22nd, 2017 at 12:54pm
Print Post  
If you have a paid version of visual micro or are using the trial then add a board.txt to the root of the project. You can use the visual micro add code menu to do that for you.

Add the following to the board.txt

Code
Select All
build.code_debug=5 



Then click the save button

Then try a build.



You can remove your extra define because the core you are using sets it from property {build.code_debug}. This is why you have to override the core with board.txt
  
Back to top
WWW  
IP Logged
 
iain frew
Junior Member
**
Offline


Posts: 11
Joined: Nov 17th, 2017
Re: How to set CONFIG_LOG_DEFAULT_LEVEL
Reply #9 - Nov 23rd, 2017 at 7:56pm
Print Post  
Awesome!!! Thanks for that tip! I didn't realize you could override the board.txt properties that way.

Many thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint