Android display OpenCore logs

476 Views Asked by At

I am trying to display opencore logs. I have already tried the ff. but still logs are not showing in the logcat.

1. created pvlogger.txt in sdcard and still no use.
# echo 8 > /sdcard/pvlogger.txt
2. Edited the PV_LOG_INST_LEVEL from 0 to 5 in the pvlogger.h file but it causes the compilation to fail.
"/android_log_appender.h:75: error:" format not a string literal and no format argument"
So I have just commented out Line 75, although it compiled successfully, opencore logs are still not showing in the logcat.

Is there anyone who were able to display the opencore logs?

Thanks in advance.

artsylar

2

There are 2 best solutions below

0
artsylar On BEST ANSWER

After trial and errors, I was finally able to show the OpenCore log messages! Here's what I did although I do not know yet if steps 4 and make options are needed.

  1. Added #define PV_LOG_INST_LEVEL 5 to \android\external\opencore\android\thread_init.cpp file.
  2. To solve the "/android_log_appender.h:75: error:" format not a string literal and no format argument" error, just edit \external\opencore\android\android_log_appender.h line 75 from LOGE(stringbuf) to LOGE("%s", stringbuf)
  3. compile the code.
    make ENABLE_PV_LOGGING=1
  4. create pvlogger.txt in sdcard.
    # echo 8 > /sdcard/pvlogger.txt



0
Yi Jingang On

I had this issue three months ago. Please don't comment out LOGE(stringbuf) in /android_log_appender.h, otherwise there is no log out. LOGE("%s", stringbuf) instead of LOGE(stringbuf).

1. created pvlogger.txt in sdcard and still no use. 
   `# echo 8 > /sdcard/pvlogger.txt`
2. Edited the PV_LOG_INST_LEVEL from 0 to 5 in the pvlogger.h.
3. ENABLE_PV_LOGGING from 0 to 1 in the pvlogger.h.
4. LOGE("%s", stringbuf) instead of LOGE(stringbuf) in /android_log_appender.h.

Wish you success!