api: truncate long log lines with …

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2021-02-02 09:20:56 +01:00
parent 7a6bab7f04
commit 41b77964ca

View File

@ -33,8 +33,10 @@ LoggerLog(_In_ WINTUN_LOGGER_LEVEL Level, _In_z_ const WCHAR *Function, _In_z_ c
{ {
WCHAR Combined[0x400]; WCHAR Combined[0x400];
if (_snwprintf_s(Combined, _countof(Combined), _TRUNCATE, L"%s: %s", Function, LogLine) == -1) if (_snwprintf_s(Combined, _countof(Combined), _TRUNCATE, L"%s: %s", Function, LogLine) == -1)
Logger(Level, LogLine); {
else Combined[_countof(Combined) - 2] = L'\u2026'; /* Horizontal Ellipsis */
Combined[_countof(Combined) - 1] = 0;
}
Logger(Level, Combined); Logger(Level, Combined);
} }
else else