MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetLogPath

Function GetLogPath

Library/OcDebugLogLib/OcLog.c:99–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99STATIC
100CHAR16 *
101GetLogPath (
102 IN CONST CHAR16 *LogPrefixPath
103 )
104{
105 EFI_STATUS Status;
106 EFI_TIME Date;
107 CHAR16 *LogPath;
108 UINTN Size;
109
110 if (LogPrefixPath == NULL) {
111 return NULL;
112 }
113
114 Status = gRT->GetTime (&Date, NULL);
115 if (EFI_ERROR(Status)) {
116 ZeroMem (&Date, sizeof (Date));
117 }
118
119 Size = StrSize (LogPrefixPath) + L_STR_SIZE (L"-0000-00-00-000000.txt");
120
121 LogPath = AllocatePool (Size);
122 if (LogPath == NULL) {
123 return NULL;
124 }
125
126 UnicodeSPrint (
127 LogPath,
128 Size,
129 L"%s-%04u-%02u-%02u-%02u%02u%02u.txt",
130 LogPrefixPath,
131 (UINT32) Date.Year,
132 (UINT32) Date.Month,
133 (UINT32) Date.Day,
134 (UINT32) Date.Hour,
135 (UINT32) Date.Minute,
136 (UINT32) Date.Second
137 );
138
139 return LogPath;
140}
141
142EFI_STATUS
143EFIAPI

Callers 1

OcConfigureLogProtocolFunction · 0.85

Calls 4

ZeroMemFunction · 0.50
StrSizeFunction · 0.50
AllocatePoolFunction · 0.50
UnicodeSPrintFunction · 0.50

Tested by

no test coverage detected