This patch adds a new interface that partners must provide to Cdm::initialize(), ILogger. ILogger replaces stderr as the sink to which logging messages are sent. For partners that still want to log to stderr, a reference implementation that logs to stderr is provided. As a side-effect of this, many test-related source files had to be updated to thread the new parameter to Cdm::initialize() through them. This also necessitated adding a new variant of FormatString() that can be called with a va_list directly so it can be called from other functions that take varargs. Bug: 201446862 Merged from https://widevine-internal-review.googlesource.com/177270 Change-Id: Ie31a10162773883b337f3a6144cf180a2b100139
24 lines
578 B
C++
24 lines
578 B
C++
// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
#ifndef WVCDM_UTIL_STRING_FORMAT_H_
|
|
#define WVCDM_UTIL_STRING_FORMAT_H_
|
|
|
|
#include <string>
|
|
|
|
namespace wvutil {
|
|
|
|
#ifdef __GNUC__
|
|
[[gnu::format(printf, 2, 3)]]
|
|
#endif
|
|
bool FormatString(std::string* out, const char* fmt, ...);
|
|
|
|
#ifdef __GNUC__
|
|
[[gnu::format(printf, 2, 0)]]
|
|
#endif
|
|
bool VFormatString(std::string* out, const char* fmt, va_list vlist);
|
|
|
|
} // namespace wvutil
|
|
|
|
#endif // WVCDM_UTIL_STRING_FORMAT_H_
|