class LogEntry

Defined at line 53 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

LogEntry

Represents a single entry in a log, i.e., one `LOG` statement or failed

`CHECK`.

`LogEntry` is thread-compatible.

Public Members

static const int kNoVerbosityLevel
static const int kNoVerboseLevel

Public Methods

void LogEntry (const LogEntry & )

Pass `LogEntry` by reference, and do not store it as its state does not

outlive the call to `LogSink::Send()`.

Defined at line 63 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

LogEntry & operator= (const LogEntry & )

Defined at line 64 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view source_filename ()

Source file and line where the log message occurred. Taken from `__FILE__`

and `__LINE__` unless overridden by `LOG(...).AtLocation(...)`.

Take special care not to use the values returned by `source_filename()` and

`source_basename()` after the lifetime of the entry. This is always

incorrect, but it will often work in practice because they usually point

into a statically allocated character array obtained from `__FILE__`.

Statements like `LOG(INFO).AtLocation(std::string(...), ...)` will expose

the bug. If you need the data later, you must copy them.

Defined at line 75 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view source_basename ()

Defined at line 78 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

int source_line ()

Defined at line 81 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

bool prefix ()

LogEntry::prefix()

True unless the metadata prefix was suppressed once by

`LOG(...).NoPrefix()` or globally by `absl::EnableLogPrefix(false)`.

Implies `text_message_with_prefix() == text_message()`.

Defined at line 88 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::LogSeverity log_severity ()

LogEntry::log_severity()

Returns this entry's severity. For `LOG`, taken from the first argument;

for `CHECK`, always `absl::LogSeverity::kFatal`.

Defined at line 94 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

int verbosity ()

LogEntry::verbosity()

Returns this entry's verbosity, or `kNoVerbosityLevel` for a non-verbose

entry. Taken from the argument to `VLOG` or from

`LOG(...).WithVerbosity(...)`.

Defined at line 101 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::Time timestamp ()

LogEntry::timestamp()

Returns the time at which this entry was written. Captured during

evaluation of `LOG`, but can be overridden by

`LOG(...).WithTimestamp(...)`.

Take care not to rely on timestamps increasing monotonically, or even to

rely on timestamps having any particular relationship with reality (since

they can be overridden).

Defined at line 112 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

tid_t tid ()

LogEntry::tid()

Returns the ID of the thread that wrote this entry. Captured during

evaluation of `LOG`, but can be overridden by `LOG(...).WithThreadID(...)`.

Take care not to *rely* on reported thread IDs as they can be overridden as

specified above.

Defined at line 121 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view text_message_with_prefix_and_newline ()

Text-formatted version of the log message. An underlying buffer holds

these contiguous data:

* A prefix formed by formatting metadata (timestamp, filename, line number,

etc.)

The prefix may be empty - see `LogEntry::prefix()` - and may rarely be

truncated if the metadata are very long.

* The streamed data

The data may be empty if nothing was streamed, or may be truncated to fit

the buffer.

* A newline

* A nul terminator

The newline and nul terminator will be present even if the prefix and/or

data are truncated.

These methods give access to the most commonly useful substrings of the

buffer's contents. Other combinations can be obtained with substring

arithmetic.

The buffer does not outlive the entry; if you need the data later, you must

copy them.

Defined at line 145 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view text_message_with_prefix ()

Defined at line 151 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view text_message_with_newline ()

Defined at line 157 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view text_message ()

Defined at line 163 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

const char * text_message_with_prefix_and_newline_c_str ()

Defined at line 168 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view encoded_message ()

Returns a serialized protobuf holding the operands streamed into this

log message. The message definition is not yet published.

The buffer does not outlive the entry; if you need the data later, you must

copy them.

Defined at line 178 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

absl::string_view stacktrace ()

LogEntry::stacktrace()

Optional stacktrace, e.g. for `FATAL` logs and failed `CHECK`s.

Fatal entries are dispatched to each sink twice: first with all data and

metadata but no stacktrace, and then with the stacktrace. This is done

because stacktrace collection is sometimes slow and fallible, and it's

critical to log enough information to diagnose the failure even if the

stacktrace collection hangs.

The buffer does not outlive the entry; if you need the data later, you must

copy them.

Defined at line 194 of file ../../third_party/abseil-cpp/absl/log/log_entry.h

Friends

class LogMessage
class LogEntryTestPeer