Skip to content

Commit

Permalink
error marker working
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiqiii committed Jul 10, 2024
1 parent 005cfdd commit e1b873d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AdvLoggerPkg/Include/AdvancedLoggerInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ typedef struct {
//
#define ADVANCED_LOGGER_LOCATOR_NAME L"AdvLoggerLocator"

#define ERROR_IDENTIFIER "[LOG_ERROR]"

extern EFI_GUID gAdvancedLoggerHobGuid;

#endif // __ADVANCED_LOGGER_INTERNAL_H__
6 changes: 6 additions & 0 deletions AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/DebugLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <Library/BaseMemoryLib.h>
#include <Library/DebugPrintErrorLevelLib.h>

#define ERROR_IDENTIFIER_LENGTH 11

/**
Prints a debug message to the debug output device if the specified
error level is enabled.
Expand Down Expand Up @@ -168,6 +170,10 @@ DebugPrintMarker (
AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMarker);
}

if (ErrorLevel == DEBUG_ERROR) {
AdvancedLoggerWrite (ErrorLevel, ERROR_IDENTIFIER, ERROR_IDENTIFIER_LENGTH);
}

//
// Send the print string to the Advanced Logger
//
Expand Down
4 changes: 4 additions & 0 deletions AdvLoggerPkg/Library/PeiDebugLibAdvancedLogger/DebugLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ DebugVPrint (
(VOID **)&AdvLoggerPpi
);
if (Status == EFI_SUCCESS) {
if (ErrorLevel == DEBUG_ERROR) {
AdvLoggerPpi->AdvancedLoggerPrintPpi (ErrorLevel, ERROR_IDENTIFIER, VaListMarker);
}

AdvLoggerPpi->AdvancedLoggerPrintPpi (ErrorLevel, Format, VaListMarker);
}
}
Expand Down

0 comments on commit e1b873d

Please sign in to comment.