Add support for logging absl::string_view.
Bug: webrtc:8982 Change-Id: I5691f91ea663756666cf187ee223ede50f87d5f0 Reviewed-on: https://webrtc-review.googlesource.com/99840 Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24707}
This commit is contained in:
@ -55,6 +55,7 @@
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
@ -174,7 +175,7 @@ enum class LogArgType : int8_t {
|
||||
kLongDouble,
|
||||
kCharP,
|
||||
kStdString,
|
||||
// TODO(kwiberg): Add absl::StringView.
|
||||
kStringView,
|
||||
kVoidP,
|
||||
kLogMetadata,
|
||||
kLogMetadataErr,
|
||||
@ -236,7 +237,10 @@ inline Val<LogArgType::kStdString, const std::string*> MakeVal(
|
||||
const std::string& x) {
|
||||
return {&x};
|
||||
}
|
||||
// TODO(kwiberg): Add absl::string_view
|
||||
inline Val<LogArgType::kStringView, const absl::string_view*> MakeVal(
|
||||
const absl::string_view& x) {
|
||||
return {&x};
|
||||
}
|
||||
|
||||
inline Val<LogArgType::kVoidP, const void*> MakeVal(const void* x) {
|
||||
return {x};
|
||||
|
||||
Reference in New Issue
Block a user