| 140 | } |
| 141 | |
| 142 | EFI_STATUS |
| 143 | EFIAPI |
| 144 | OcLogAddEntry ( |
| 145 | IN OC_LOG_PROTOCOL *OcLog, |
| 146 | IN UINTN ErrorLevel, |
| 147 | IN CONST CHAR8 *FormatString, |
| 148 | IN VA_LIST Marker |
| 149 | ) |
| 150 | { |
| 151 | EFI_STATUS Status; |
| 152 | |
| 153 | OC_LOG_PRIVATE_DATA *Private; |
| 154 | UINT32 Attributes; |
| 155 | UINT32 TimingLength; |
| 156 | UINT32 LineLength; |
| 157 | APPLE_PLATFORM_DATA_RECORD *Entry; |
| 158 | UINT32 KeySize; |
| 159 | UINT32 DataSize; |
| 160 | UINT32 TotalSize; |
| 161 | |
| 162 | Private = OC_LOG_PRIVATE_DATA_FROM_OC_LOG_THIS (OcLog); |
| 163 | |
| 164 | if ((OcLog->Options & OC_LOG_ENABLE) == 0) { |
| 165 | // |
| 166 | // Silently ignore when disabled. |
| 167 | // |
| 168 | return EFI_SUCCESS; |
| 169 | } |
| 170 | |
| 171 | AsciiVSPrint ( |
| 172 | Private->LineBuffer, |
| 173 | sizeof (Private->LineBuffer), |
| 174 | FormatString, |
| 175 | Marker |
| 176 | ); |
| 177 | |
| 178 | // |
| 179 | // Add Entry. |
| 180 | // |
| 181 | |
| 182 | Status = EFI_SUCCESS; |
| 183 | |
| 184 | if (*Private->LineBuffer != '\0') { |
| 185 | GetTiming (OcLog); |
| 186 | |
| 187 | // |
| 188 | // Send the string to the console output device. |
| 189 | // |
| 190 | if ((OcLog->Options & OC_LOG_CONSOLE) != 0 && (OcLog->DisplayLevel & ErrorLevel) != 0) { |
| 191 | UnicodeSPrint ( |
| 192 | Private->UnicodeLineBuffer, |
| 193 | sizeof (Private->UnicodeLineBuffer), |
| 194 | L"%a", |
| 195 | Private->LineBuffer |
| 196 | ); |
| 197 | gST->ConOut->OutputString (gST->ConOut, Private->UnicodeLineBuffer); |
| 198 | |
| 199 | if (OcLog->DisplayDelay > 0) { |
nothing calls this directly
no test coverage detected