Open arilink opened 8 months ago
@kisvegabor @microwavesafe @SIvaCoHan @rzr
I see it on the Terminal tab:
Are you the latest code pulled? I can't print using printf or LV_LOG_Error
Yes, I tried the latest with printf. Do you check the terminal tab?
yes. no log show
What is format:
? Can you try just a simply printf("Hello\n");
it is just a code hint
I'll just use printf("Hello\n"); The same
I changed 3 cumputer. all computer is not have log
What is
format:
? Can you try just a simplyprintf("Hello\n");
Can you shared your Code? I use it to compare
Really nothing special. Just cloned the project as it is and added printf("asd\n")
in main.c
.
@kisvegabor Hello senior, I re-built a V8.4 development environment using CLion, which can output log normally. Then I used CLion_V8.4 code to replace the Driver and LVGL code in LV_For_VS_Code respectively, which still cannot output Log, so it can be inferred that, There is a problem with my computer or LV_For_VS_Code code. Could you please help send an LV_For_VS_Code Project in which you can output Log so that I can troubleshoot the computer problem
That's strange, however I'm using this repo as it is, so you can just clone my project from here :slightly_smiling_face:
Maybe @danyyliu has some ideas.
I try to use uart to show log. it still no log...
So it's an UART log. I completely missed that part so far.
I think the problem is that you need to disable LV_LOG_PRINTF
. If it's enabled the custom print callback is not called.
yes use uart log ok,but use default still not work,should i enable LV_OS_WINDOWS?
So it's an UART log. I completely missed that part so far.
I think the problem is that you need to disable
LV_LOG_PRINTF
. If it's enabled the custom print callback is not called.
No. I can't fix this problem. so i try to use windows uart
I find a new way to fix this problem.but when i use LV_LOG_XX. the color log is not work. The specific content is as follows: void use_console_output() //打印窗口 { AllocConsole(); FILE *stream; freopen_s(&stream, "CONOUT$", "w", stdout); freopen_s(&stream, "CONIN$", "r", stdin); }
In my mind, this is an issue caused by some code related with the Windows system.
From the previous information, I think we can get a conclusion that printf doesn't work, while uart is ok. It doesn't make sense that printf doesn't work, unless there are some code is manipulating the console, which can also explain why the issue can be fixed by calling AllocConsole. I don't think LVGL can support color log for windows console now, since SetConsoleTextAttribute should be used to set the color.
I'm not an expert of Windows program, please let me know if I am correct.
So from the current results, the problem is not related to LVGL, which has the log ready, but the windows console is not starting correctly or vscode is not receiving information from the console
I use CLion for comparison. When CLion runs the demo, it will open a new console, and the information in the console will be displayed in the IDE, while VSCode does not. Does this mean that VSCode did not wake up the console correctly? @kisvegabor @danyyliu Can you see how many consoles are added to the system when you run the demo using VSCode?
I haven't done any test like this in Windows. Could you please try it with hello world test without LVGL? I want to see what happens with the console in this situation.
It can print correct log
So, it should not be an issue of vscode or clion. Maybe you can check if there is any code in your project is doing something with the console.
I tried to build and run this project in Windows, it seems the console can work well:
This is the only project I opened and I didn't do anything else with the console, which is weird
@danyyliu I suddenly thought of a point, is it related to SDL_Main?
I think this is related to SDL.
Does simple printf work instead of LV_LOG?
I tested MacOS and everything is normal.
How does your lv_conf.h
looks like? Please also open lvgl
to the latest from master
. There some logging related fixes earlier.
I use lv_port_pc_eclipse and lv_port_pc_vscode to add Printf or LV_LOG_ERROR and I can't output log. Why?