Skip to content

Commit aea10a3

Browse files
authored
Revise OSK error messages (#817)
## Description Present OSK messages include the error level (e.g. "[ERROR] OSK: <msg>"). This PR removes those tags. This allows better filtering of logs for actual actionable errors, as well as avoiding redundancy when interpreted by a log viewer that also tags each message according to the error level. Debug message changes only, no functional change. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Booted system, observed error messages changed as expected. ## Integration Instructions N/A
1 parent ce04480 commit aea10a3

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

MsGraphicsPkg/OnScreenKeyboardDxe/OnScreenKeyboardDriver.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ OSKDriverBindingStart (
213213
EFI_OPEN_PROTOCOL_BY_DRIVER
214214
);
215215
if (EFI_ERROR (Status)) {
216-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Device Path already opened (%r).\r\n", Status));
216+
DEBUG ((DEBUG_INFO, "[OSK]: Device Path already opened (%r).\r\n", Status));
217217
return Status;
218218
}
219219

@@ -227,7 +227,7 @@ OSKDriverBindingStart (
227227

228228
if (EFI_ERROR (Status)) {
229229
mSWMProtocol = NULL;
230-
DEBUG ((DEBUG_WARN, "ERROR [OSK]: Failed to find Simple Window Manager protocol (%r).\r\n", Status));
230+
DEBUG ((DEBUG_WARN, "[OSK]: Failed to find Simple Window Manager protocol (%r).\r\n", Status));
231231
goto ErrorExit;
232232
}
233233

@@ -241,14 +241,14 @@ OSKDriverBindingStart (
241241

242242
if (EFI_ERROR (Status)) {
243243
mGop = NULL;
244-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to find GOP protocol (%r).\r\n", Status));
244+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to find GOP protocol (%r).\r\n", Status));
245245
goto ErrorExit;
246246
}
247247

248248
// Initialize OSK
249249
Status = OSKDriverInit ();
250250
if (EFI_ERROR (Status)) {
251-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Init OSK Failed (%r).\r\n", Status));
251+
DEBUG ((DEBUG_ERROR, "[OSK]: Init OSK Failed (%r).\r\n", Status));
252252

253253
if (mKeyRepeatTimerEvent != NULL) {
254254
// you would be here if the driver init failed
@@ -282,7 +282,7 @@ OSKDriverBindingStart (
282282
}
283283

284284
// everything successful
285-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Init OSK Successful (%r).\r\n", Status));
285+
DEBUG ((DEBUG_INFO, "[OSK]: Init OSK Successful (%r).\r\n", Status));
286286
goto Exit;
287287

288288
ErrorExit:
@@ -322,7 +322,7 @@ OSKDriverBindingStop (
322322
{
323323
EFI_STATUS Status;
324324

325-
DEBUG ((DEBUG_INFO, "INFO [OSK]: DriverBindingStop. \r\n"));
325+
DEBUG ((DEBUG_INFO, "[OSK]: DriverBindingStop. \r\n"));
326326
Status = gBS->UninstallMultipleProtocolInterfaces (
327327
ControllerHandle,
328328
&gEfiSimpleTextInProtocolGuid,
@@ -616,7 +616,7 @@ HandleDisplayModeChange (
616616
BOOLEAN bShowKeyboard = mOSK.bDisplayKeyboard;
617617
SWM_RECT Rect;
618618

619-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Display mode change detected (Old=%dx%d New=%dx%d).\r\n", mOSK.ScreenResolutionWidth, mOSK.ScreenResolutionHeight, ScreenWidth, ScreenHeight));
619+
DEBUG ((DEBUG_INFO, "[OSK]: Display mode change detected (Old=%dx%d New=%dx%d).\r\n", mOSK.ScreenResolutionWidth, mOSK.ScreenResolutionHeight, ScreenWidth, ScreenHeight));
620620

621621
AllocateBackBuffers ();
622622

@@ -1514,14 +1514,14 @@ SetKeyboardPosition (
15141514
EFI_STATUS Status = EFI_SUCCESS;
15151515

15161516
if (mGop == NULL) {
1517-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] Cannot set keyboardposition, GOP not yet initialized %x %x\n", Position, DockedState));
1517+
DEBUG ((DEBUG_ERROR, "[OSK] Cannot set keyboardposition, GOP not yet initialized %x %x\n", Position, DockedState));
15181518
mOSK.KeyboardPosition = Position;
15191519
mOSK.DockedState = DockedState;
15201520
goto Exit;
15211521
}
15221522

15231523
if (mSWMProtocol == NULL) {
1524-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] Cannot set keyboardposition, SWM protocol not yet initialized %x %x\n", Position, DockedState));
1524+
DEBUG ((DEBUG_ERROR, "[OSK] Cannot set keyboardposition, SWM protocol not yet initialized %x %x\n", Position, DockedState));
15251525
mOSK.KeyboardPosition = Position;
15261526
mOSK.DockedState = DockedState;
15271527
goto Exit;
@@ -1751,13 +1751,13 @@ SetKeyboardSize (
17511751
SWM_RECT Rect;
17521752

17531753
if (mGop == NULL) {
1754-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] GOP not yet initialized. Cannot set the keyboard size. Default size will be retained \n"));
1754+
DEBUG ((DEBUG_ERROR, "[OSK] GOP not yet initialized. Cannot set the keyboard size. Default size will be retained \n"));
17551755
mOSK.PercentOfScreenWidth = PercentOfScreenWidth;
17561756
goto Exit;
17571757
}
17581758

17591759
if (mSWMProtocol == NULL) {
1760-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] SWM protocol not yet initialized. Cannot set the keyboard size. Default size will be retained \n"));
1760+
DEBUG ((DEBUG_ERROR, "[OSK] SWM protocol not yet initialized. Cannot set the keyboard size. Default size will be retained \n"));
17611761
mOSK.PercentOfScreenWidth = PercentOfScreenWidth;
17621762
goto Exit;
17631763
}
@@ -1857,7 +1857,7 @@ GetKeyboardMode (
18571857
*ModeBitfield |= OSK_MODE_SELF_REFRESH;
18581858
}
18591859

1860-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Retrieved keyboard mode 0x%08x. Status = %r\r\n", *ModeBitfield, Status));
1860+
DEBUG ((DEBUG_INFO, "[OSK]: Retrieved keyboard mode 0x%08x. Status = %r\r\n", *ModeBitfield, Status));
18611861

18621862
return Status;
18631863
}
@@ -1885,7 +1885,7 @@ SetKeyboardMode (
18851885
//
18861886
mOSK.bKeyboardSelfRefresh = ((ModeBitfield & OSK_MODE_SELF_REFRESH) ? TRUE : FALSE);
18871887

1888-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Set keyboard mode 0x%08x. Status = %r\r\n", ModeBitfield, Status));
1888+
DEBUG ((DEBUG_INFO, "[OSK]: Set keyboard mode 0x%08x. Status = %r\r\n", ModeBitfield, Status));
18891889
// Disable the key repeat timer
18901890
//
18911891
gBS->SetTimer (
@@ -1941,7 +1941,7 @@ ShowKeyboard (
19411941
}
19421942

19431943
if (mSWMProtocol == NULL) {
1944-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: SWM protocol not yet initialized. Cannot change ShowKeyboard mode 0x%08x.\n", bShowKeyboard));
1944+
DEBUG ((DEBUG_ERROR, "[OSK]: SWM protocol not yet initialized. Cannot change ShowKeyboard mode 0x%08x.\n", bShowKeyboard));
19451945
mOSK.bDisplayKeyboard = bShowKeyboard;
19461946
goto Exit;
19471947
}
@@ -2002,13 +2002,13 @@ ShowKeyboardIcon (
20022002
EFI_STATUS Status = EFI_SUCCESS;
20032003

20042004
if (mGop == NULL) {
2005-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Cannot change ShowKeyboardIcon. GOP not found 0x%08x\n", bShowKeyboardIcon));
2005+
DEBUG ((DEBUG_ERROR, "[OSK]: Cannot change ShowKeyboardIcon. GOP not found 0x%08x\n", bShowKeyboardIcon));
20062006
mOSK.bDisplayKeyboardIcon = bShowKeyboardIcon;
20072007
goto Exit;
20082008
}
20092009

20102010
if (mSWMProtocol == NULL) {
2011-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: SWM protocol not yet initialized. Cannot change ShowKeyboardIcon 0x%08x\n", bShowKeyboardIcon));
2011+
DEBUG ((DEBUG_ERROR, "[OSK]: SWM protocol not yet initialized. Cannot change ShowKeyboardIcon 0x%08x\n", bShowKeyboardIcon));
20122012
mOSK.bDisplayKeyboardIcon = bShowKeyboardIcon;
20132013
goto Exit;
20142014
}
@@ -2374,7 +2374,7 @@ RotateKeyboard (
23742374
float Zang = 0.0;
23752375

23762376
if (mGop == NULL) {
2377-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] Failed to find GOP protocol \n"));
2377+
DEBUG ((DEBUG_ERROR, "[OSK] Failed to find GOP protocol \n"));
23782378
mOSK.KeyboardAngle = Angle;
23792379
goto Exit;
23802380
}
@@ -2472,7 +2472,7 @@ InsertKeyPressIntoQueue (
24722472
// If queue input and output positions collide, there is a buffer overflow
24732473
//
24742474
if ((mOSK.QueueInputPosition == mOSK.QueueOutputPosition) && (FALSE == mOSK.bQueueEmpty)) {
2475-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Key press input queue overflow!\r\n"));
2475+
DEBUG ((DEBUG_INFO, "[OSK]: Key press input queue overflow!\r\n"));
24762476
return EFI_OUT_OF_RESOURCES;
24772477
}
24782478

@@ -2712,7 +2712,7 @@ KeyboardInputHandler (
27122712
goto Exit;
27132713
}
27142714

2715-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Keyboard dock-undock button selected.\r\n"));
2715+
DEBUG ((DEBUG_INFO, "[OSK]: Keyboard dock-undock button selected.\r\n"));
27162716

27172717
//
27182718
// Docking/Undocking button was selected - toggle docked state.
@@ -2725,7 +2725,7 @@ KeyboardInputHandler (
27252725
//
27262726
// Close button was selected - dismiss the keyboard...
27272727
//
2728-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Keyboard close button selected.\r\n"));
2728+
DEBUG ((DEBUG_INFO, "[OSK]: Keyboard close button selected.\r\n"));
27292729

27302730
// Hide the keyboard and show the keyboard icon
27312731
//
@@ -2763,7 +2763,7 @@ KeyboardInputHandler (
27632763
);
27642764

27652765
if (EFI_ERROR (Status)) {
2766-
DEBUG ((DEBUG_WARN, "WARN [OSK]: Failed to start key repeat timer. Status = %r\r\n", Status));
2766+
DEBUG ((DEBUG_WARN, "[OSK]: Failed to start key repeat timer. Status = %r\r\n", Status));
27672767
}
27682768
}
27692769
} else {
@@ -2839,7 +2839,7 @@ OSKReadKeyStroke (
28392839
// on the event to signal that there is one.
28402840
//
28412841
if ((FALSE == mOSK.bDisplayKeyboardIcon) && (FALSE == mOSK.bDisplayKeyboard) && (TRUE == mOSK.bKeyboardIconAutoEnable)) {
2842-
DEBUG ((DEBUG_INFO, "INFO [OSK]: OSKReadKeyStroke: Auto-activating the keyboard icon.\r\n"));
2842+
DEBUG ((DEBUG_INFO, "[OSK]: OSKReadKeyStroke: Auto-activating the keyboard icon.\r\n"));
28432843

28442844
// Display the keyboard icon. Assume the keyboard and icon positions, sizes, and states have already been configured.
28452845
//
@@ -2930,7 +2930,7 @@ OSKWaitForKey (
29302930
// on the event to signal that there is one.
29312931
//
29322932
if ((FALSE == mOSK.bDisplayKeyboardIcon) && (FALSE == mOSK.bDisplayKeyboard) && (TRUE == mOSK.bKeyboardIconAutoEnable)) {
2933-
DEBUG ((DEBUG_INFO, "INFO [OSK]: OSKWaitForKey: Auto-activating the keyboard icon.\r\n"));
2933+
DEBUG ((DEBUG_INFO, "[OSK]: OSKWaitForKey: Auto-activating the keyboard icon.\r\n"));
29342934

29352935
// Display the keyboard icon. Assume the keyboard and icon positions, sizes, and states have already been configured.
29362936
//
@@ -2987,7 +2987,7 @@ OSKKeyRepeatCallback (
29872987
);
29882988

29892989
if (EFI_ERROR (Status)) {
2990-
DEBUG ((DEBUG_WARN, "WARN [OSK]: Failed to update key repeat timer interval. Status = %r\r\n", Status));
2990+
DEBUG ((DEBUG_WARN, "[OSK]: Failed to update key repeat timer interval. Status = %r\r\n", Status));
29912991
}
29922992
}
29932993

@@ -3044,7 +3044,7 @@ OSKProcessPointerCallback (
30443044
return FALSE;
30453045
}
30463046

3047-
DEBUG ((DEBUG_INFO, "INFO [OSK]: Keyboard icon selected.\r\n"));
3047+
DEBUG ((DEBUG_INFO, "[OSK]: Keyboard icon selected.\r\n"));
30483048

30493049
// Determine the keyboard outer bounding rectangle
30503050
//
@@ -3145,7 +3145,7 @@ OSKDriverInit (
31453145
);
31463146

31473147
if (EFI_ERROR (Status)) {
3148-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] - Failed to install OSK protocol, Status: %r\r\n", Status));
3148+
DEBUG ((DEBUG_ERROR, "[OSK] - Failed to install OSK protocol, Status: %r\r\n", Status));
31493149
goto Exit;
31503150
}
31513151

@@ -3160,7 +3160,7 @@ OSKDriverInit (
31603160
);
31613161

31623162
if (EFI_ERROR (Status)) {
3163-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to create key repeat timer event. Status = %r\r\n", Status));
3163+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to create key repeat timer event. Status = %r\r\n", Status));
31643164
goto Exit;
31653165
}
31663166

@@ -3175,7 +3175,7 @@ OSKDriverInit (
31753175
);
31763176

31773177
if (EFI_ERROR (Status)) {
3178-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to create display mode timer callback event. Status = %r\r\n", Status));
3178+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to create display mode timer callback event. Status = %r\r\n", Status));
31793179
goto Exit;
31803180
}
31813181

@@ -3204,7 +3204,7 @@ OSKDriverInit (
32043204

32053205
ASSERT_EFI_ERROR (Status);
32063206
if (EFI_ERROR (Status)) {
3207-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to register with the Simple Window Manager. Status = %r\r\n", Status));
3207+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to register with the Simple Window Manager. Status = %r\r\n", Status));
32083208
goto Exit;
32093209
}
32103210

@@ -3213,7 +3213,7 @@ OSKDriverInit (
32133213
Status = InitializeKeyboardGeometry ();
32143214

32153215
if (EFI_ERROR (Status)) {
3216-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to initialize keyboard geometry. Status = %r\r\n", Status));
3216+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to initialize keyboard geometry. Status = %r\r\n", Status));
32173217
goto Exit;
32183218
}
32193219

@@ -3238,7 +3238,7 @@ OSKDriverInit (
32383238
);
32393239

32403240
if (EFI_ERROR (Status)) {
3241-
DEBUG ((DEBUG_ERROR, "ERROR [OSK]: Failed to start keyboard/icon refresh timer. Status = %r\r\n", Status));
3241+
DEBUG ((DEBUG_ERROR, "[OSK]: Failed to start keyboard/icon refresh timer. Status = %r\r\n", Status));
32423242
goto Exit;
32433243
}
32443244

@@ -3341,7 +3341,7 @@ OSKDriverEntryPoint (
33413341
);
33423342

33433343
if (EFI_ERROR (Status)) {
3344-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] - Failed to initialize Simple Text Input protocol wait event, Status: %r\r\n", Status));
3344+
DEBUG ((DEBUG_ERROR, "[OSK] - Failed to initialize Simple Text Input protocol wait event, Status: %r\r\n", Status));
33453345
goto Exit;
33463346
}
33473347

@@ -3354,7 +3354,7 @@ OSKDriverEntryPoint (
33543354
);
33553355

33563356
if (EFI_ERROR (Status)) {
3357-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] - Failed to initialize Simple Text Input Extended protocol wait event, Status: %r\r\n", Status));
3357+
DEBUG ((DEBUG_ERROR, "[OSK] - Failed to initialize Simple Text Input Extended protocol wait event, Status: %r\r\n", Status));
33583358
goto Exit;
33593359
}
33603360

@@ -3381,7 +3381,7 @@ OSKDriverEntryPoint (
33813381
ASSERT_EFI_ERROR (Status);
33823382

33833383
if (EFI_ERROR (Status)) {
3384-
DEBUG ((DEBUG_ERROR, "ERROR [OSK] - Failed to install OSK protocol, Status: %r\r\n", Status));
3384+
DEBUG ((DEBUG_ERROR, "[OSK] - Failed to install OSK protocol, Status: %r\r\n", Status));
33853385
goto Exit;
33863386
}
33873387

0 commit comments

Comments
 (0)