aboutsummaryrefslogtreecommitdiff
path: root/absl/log/internal/test_actions.cc
diff options
context:
space:
mode:
authorAndy Getzendanner <durandal@google.com>2022-11-17 12:17:17 -0800
committerCopybara-Service <copybara-worker@google.com>2022-11-17 12:18:03 -0800
commitebab79b5783b3298ee2f31251174c660c322d7ef (patch)
tree1b5309a16ca6e3c871b9df96d10a036f73cdc3eb /absl/log/internal/test_actions.cc
parent0c048353d2e7347f148228d785c3f0a8c81e2223 (diff)
downloadabseil-ebab79b5783b3298ee2f31251174c660c322d7ef.tar.gz
abseil-ebab79b5783b3298ee2f31251174c660c322d7ef.tar.bz2
abseil-ebab79b5783b3298ee2f31251174c660c322d7ef.zip
Release structured logging.
This stores the operands to LOG (and CHECK) as separate fields in a serialized protobuf. The protobuf format is not yet published. PiperOrigin-RevId: 489275799 Change-Id: I86d83671a6b1feb2bddd5bee51552907897ca8eb
Diffstat (limited to 'absl/log/internal/test_actions.cc')
-rw-r--r--absl/log/internal/test_actions.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/absl/log/internal/test_actions.cc b/absl/log/internal/test_actions.cc
index 6c8a7b13..bb4af17f 100644
--- a/absl/log/internal/test_actions.cc
+++ b/absl/log/internal/test_actions.cc
@@ -40,16 +40,19 @@ void WriteEntryToStderr::operator()(const absl::LogEntry& entry) const {
const std::string source_filename = absl::CHexEscape(entry.source_filename());
const std::string source_basename = absl::CHexEscape(entry.source_basename());
const std::string text_message = absl::CHexEscape(entry.text_message());
- std::cerr << "LogEntry{\n" //
- << " source_filename: \"" << source_filename << "\"\n" //
- << " source_basename: \"" << source_basename << "\"\n" //
- << " source_line: " << entry.source_line() << "\n" //
- << " prefix: " << (entry.prefix() ? "true\n" : "false\n") //
- << " log_severity: " << entry.log_severity() << "\n" //
- << " timestamp: " << entry.timestamp() << "\n" //
- << " text_message: \"" << text_message << "\"\n" //
- << " verbosity: " << entry.verbosity()
- << "\n" //
+ const std::string encoded_message = absl::CHexEscape(entry.encoded_message());
+ std::string encoded_message_str;
+ std::cerr << "LogEntry{\n" //
+ << " source_filename: \"" << source_filename << "\"\n" //
+ << " source_basename: \"" << source_basename << "\"\n" //
+ << " source_line: " << entry.source_line() << "\n" //
+ << " prefix: " << (entry.prefix() ? "true\n" : "false\n") //
+ << " log_severity: " << entry.log_severity() << "\n" //
+ << " timestamp: " << entry.timestamp() << "\n" //
+ << " text_message: \"" << text_message << "\"\n" //
+ << " verbosity: " << entry.verbosity() << "\n" //
+ << " encoded_message (raw): \"" << encoded_message << "\"\n" //
+ << encoded_message_str //
<< "}\n";
}