[#absl-LogEntry] = xref:absl.adoc[absl]::LogEntry :relfileprefix: ../ :mrdocs: Represents a single entry in a log, i.e., one `LOG` statement or failed `CHECK`. == Synopsis Declared in `<absl/log/log_entry.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class LogEntry final ---- == Description `LogEntry` is thread‐compatible. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:absl/LogEntry/tid_t.adoc[`tid_t`] | Type used to represent a thread ID. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/LogEntry/2constructor.adoc[`LogEntry`] [.small]#[constructor]# [.small]#[deleted]# | Deleted; pass `LogEntry` by reference instead, and do not store it as its state does not outlive the call to `LogSink::Send()`. | xref:absl/LogEntry/operator_assign.adoc[`operator=`] [.small]#[deleted]# | Deleted; instances are not copy‐assignable. | xref:absl/LogEntry/encoded_message.adoc[`encoded_message`] | Returns a serialized protobuf holding the operands streamed into this log message. The message definition is not yet published. | xref:absl/LogEntry/log_severity.adoc[`log_severity`] | Returns this entry's severity. For `LOG`, taken from the first argument; for `CHECK`, always `absl::LogSeverity::kFatal`. | xref:absl/LogEntry/prefix.adoc[`prefix`] | Returns true unless the metadata prefix was suppressed once by `LOG(...).NoPrefix()` or globally by `absl::EnableLogPrefix(false)`. Implies `text_message_with_prefix() == text_message()`. | xref:absl/LogEntry/source_basename.adoc[`source_basename`] | Returns the source file base name where the log message occurred. | xref:absl/LogEntry/source_filename.adoc[`source_filename`] | Returns the source file name where the log message occurred, taken from `*FILE*` unless overridden by `LOG(...).AtLocation(...)`. | xref:absl/LogEntry/source_line.adoc[`source_line`] | Returns the source line where the log message occurred, taken from `*LINE*` unless overridden by `LOG(...).AtLocation(...)`. | xref:absl/LogEntry/stacktrace.adoc[`stacktrace`] | Returns the optional stacktrace, e.g. for `FATAL` logs and failed `CHECK`s. | xref:absl/LogEntry/text_message.adoc[`text_message`] | Returns the text‐formatted message without its metadata prefix and without a trailing newline. | xref:absl/LogEntry/text_message_with_newline.adoc[`text_message_with_newline`] | Returns the text‐formatted message without its metadata prefix, with a trailing newline. | xref:absl/LogEntry/text_message_with_prefix.adoc[`text_message_with_prefix`] | Returns the text‐formatted message including its metadata prefix, but without a trailing newline. | xref:absl/LogEntry/text_message_with_prefix_and_newline.adoc[`text_message_with_prefix_and_newline`] | Returns the text‐formatted message including its metadata prefix and trailing newline. | xref:absl/LogEntry/text_message_with_prefix_and_newline_c_str.adoc[`text_message_with_prefix_and_newline_c_str`] | Returns a nul‐terminated C string of the text‐formatted message including its metadata prefix and trailing newline. | xref:absl/LogEntry/tid.adoc[`tid`] | Returns the ID of the thread that wrote this entry. Captured during evaluation of `LOG`, but can be overridden by `LOG(...).WithThreadID(...)`. | xref:absl/LogEntry/timestamp.adoc[`timestamp`] | Returns the time at which this entry was written. Captured during evaluation of `LOG`, but can be overridden by `LOG(...).WithTimestamp(...)`. | xref:absl/LogEntry/verbosity.adoc[`verbosity`] | Returns this entry's verbosity, or `kNoVerbosityLevel` for a non‐verbose entry. Taken from the argument to `VLOG` or from `LOG(...).WithVerbosity(...)`. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:absl/LogEntry/kNoVerboseLevel.adoc[`kNoVerboseLevel`] | Deprecated alias for `kNoVerbosityLevel`, to be removed. | xref:absl/LogEntry/kNoVerbosityLevel.adoc[`kNoVerbosityLevel`] | For non‐verbose log entries, `verbosity()` returns `kNoVerbosityLevel`. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:absl/PrintTo.adoc[absl::PrintTo]` | Writes a human‐readable representation of `entry` to `os`, e.g. for use by test frameworks such as GoogleTest. | `absl::log_internal::LogMessage` | |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#