On 11/10/22 12:11, Kinney, Michael D wrote:
In the edk2 repo, I see the following instances of the DebugPrintMarker() API where you are currently adding he ANSI color sequences. Should all of these be updated? I did not review the edk2-platforms repo. And there may be downstream custom DebugLib instances. It would better if this feature could be enabled for all existing DebugLib instances, but the only common location is the DEBUG() macro definition in MdePkg/Include/Library/DebugLib.h and adding code to that macro adds statements to the module calling the DebugLib services, which can increase code size.
I'll update the other instances. Given it's purely an aesthetic change, I'm not sure we need to worry about custom instances?
Also, the ErrorLevel parameter is a bitmask. It cannot be used in a switch/case statement for only 1 bit being set. To test for a debug message of type ERROR or WARN, a check must be done for that one bit being set in ErrorLevel.
Thanks, I'll fix that.
The DebugLib also provides support for ASSERT() macros. Should ASSERT() messages have the same color as an ERROR message? Or its own color?
I wasn't thinking about ASSERT messages because those are super clear being one of the last messages printed.
The logic below changes the color for the message based on message type. But is does not save/restore the current ANSI color setting. It see it using the END_ESC_SEQ. Does that put the color settings back to the previous setting?
No, it resets it to the terminal's default color scheme. I'm not aware of a way to save/restore the color.
-- Rebecca Cran -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100377): https://edk2.groups.io/g/devel/message/100377 Mute This Topic: https://groups.io/mt/94611226/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-