1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
13 // Sends string |format| to the debugger for display.
15 // This is for developers only; we don't use this in circumstances
16 // (like release builds) where users could see it.
17 void TraceImpl(const wchar_t* format, ...) {
18 constexpr int kMaxLogBufferSize = 1024;
19 wchar_t buffer[kMaxLogBufferSize] = {};
23 va_start(args, format);
24 if (vswprintf(buffer, std::size(buffer), format, args) > 0) {
25 OutputDebugString(buffer);
27 std::wstring error_string(L"Format error for string: ");
28 OutputDebugString(error_string.append(format).c_str());
32 #endif // !defined(NDEBUG)