class LogMessage

Defined at line 61 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

Public Methods

LogMessage & InternalStream ()

Don't call this method from outside this library.

Defined at line 117 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

void LogMessage (const char * _Nonnull file, int line, absl::LogSeverity severity)

Used for `LOG`. Taking `const char *` instead of `string_view` keeps

callsites a little bit smaller at the cost of doing `strlen` at runtime.

void LogMessage (absl::string_view file, int line, absl::LogSeverity severity)

Used for FFI integrations that don't have a NUL-terminated string.

void LogMessage (const char * _Nonnull file, int line, InfoTag )

These constructors are slightly smaller/faster to call; the severity is

curried into the function pointer.

void LogMessage (const char * _Nonnull file, int line, WarningTag )
void LogMessage (const char * _Nonnull file, int line, ErrorTag )
void LogMessage (const LogMessage & )

Defined at line 82 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & NoPrefix ()

Omits the prefix from this line. The prefix includes metadata about the

logged data such as source code location and timestamp.

LogMessage & WithVerbosity (int verbose_level)

Sets the verbosity field of the logged message as if it was logged by

`VLOG(verbose_level)`. Unlike `VLOG`, this method does not affect

evaluation of the statement when the specified `verbose_level` has been

disabled. The only effect is on `absl::LogSink` implementations which

make use of the `absl::LogSink::verbosity()` value. The value

`absl::LogEntry::kNoVerbosityLevel` can be specified to mark the message

not verbose.

LogMessage & WithTimestamp (absl::Time timestamp)

Uses the specified timestamp instead of one collected in the constructor.

LogMessage & WithThreadID (absl::LogEntry::tid_t tid)

Uses the specified thread ID instead of one collected in the constructor.

LogMessage & WithMetadataFrom (const absl::LogEntry & entry)

Copies all metadata (but no data) from the specified `absl::LogEntry`.

LogMessage & WithPerror ()

Appends to the logged message a colon, a space, a textual description of

the current value of `errno` (as by strerror(3)), and the numerical value

of `errno`.

LogMessage & ToSinkAlso (absl::LogSink * _Nonnull sink)

Sends this message to `*sink` in addition to whatever other sinks it would

otherwise have been sent to.

LogMessage & ToSinkOnly (absl::LogSink * _Nonnull sink)

Sends this message to `*sink` and no others.

LogMessage & operator= (const LogMessage & )

Defined at line 83 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (char v)

By-value overloads for small, common types let us overlook common failures

to define globals and static data members (i.e. in a .cc file).

NOLINTBEGIN(runtime/int)

NOLINTBEGIN(google-runtime-int)

clang-format off: The CUDA toolchain cannot handle these

<

<

<

's

Defined at line 124 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (signed char v)

Defined at line 125 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (unsigned char v)

Defined at line 126 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (short v)

Defined at line 129 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (int v)

Defined at line 132 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (long v)

Defined at line 133 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (long long v)

Defined at line 136 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (unsigned short v)

Defined at line 139 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (unsigned int v)

Defined at line 142 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (unsigned long v)

Defined at line 145 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (unsigned long long v)

Defined at line 148 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (void * _Nullable v)

Defined at line 151 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (const void * _Nullable v)

Defined at line 154 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (float v)

Defined at line 157 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (double v)

Defined at line 158 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (bool v)

Defined at line 159 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

void ~LogMessage ()
LogMessage & AtLocation (absl::string_view file, int line)

Overrides the location inferred from the callsite. The string pointed to

by `file` must be valid until the end of the statement.

LogMessage & operator<< (const std::string & v)

These overloads are more efficient since no `ostream` is involved.

LogMessage & operator<< (absl::string_view v)
LogMessage & operator<< (const std::wstring & v)

Wide string overloads (since std::ostream does not provide them).

LogMessage & operator<< (std::wstring_view v)
LogMessage & operator<< (wchar_t * _Nullable v)

`const wchar_t*` is handled by `operator

<

<

<const

wchar_t*>`.

Defined at line 307 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

LogMessage & operator<< (wchar_t v)
LogMessage & operator<< (std::ostream &(* _Nonnull)(std::ostream &) m)

Handle stream manipulators e.g. std::endl.

LogMessage & operator<< (std::ios_base &(* _Nonnull)(std::ios_base &) m)
template <int SIZE>
LogMessage & operator<< (const char (&)[SIZE] buf)

Literal strings. This allows us to record C string literals as literals in

the logging.proto.Value.

Allow this overload to be inlined to prevent generating instantiations of

this template for every value of `SIZE` encountered in each source code

file. That significantly increases linker input sizes. Inlining is cheap

because the argument to this overload is almost always a string literal so

the call to `strlen` can be replaced at compile time. The overloads for

`char[]`/`wchar_t[]` below should not be inlined. The compiler typically

does not have the string at compile time and cannot replace the call to

`strlen` so inlining it increases the binary size. See the discussion on

cl/107527369.

Defined at line 350 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

template <int SIZE>
LogMessage & operator<< (const wchar_t (&)[SIZE] buf)

Defined at line 356 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

template <int SIZE>
LogMessage & operator<< (char (&)[SIZE] buf)

This prevents non-const `char[]` arrays from looking like literals.

Defined at line 363 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

template <typename T>
LogMessage & operator<< (const T & v)

Types that support `AbslStringify()` are serialized that way.

Types that don't support `AbslStringify()` but do support streaming into a

`std::ostream

&

` are serialized that way.

Defined at line 337 of file ../../third_party/abseil-cpp/src/absl/log/internal/log_message.h

void Flush ()

Dispatches the completed `absl::LogEntry` to applicable `absl::LogSink`s.

template <>
LogMessage & operator<<<const wchar_t *> (const wchar_t *const  _Nullable & v)

Explicitly specializes the generic operator

<

<

for `const wchar_t*`

arguments.

This method is used instead of a non-template `const wchar_t*` overload,

as the latter was found to take precedence over the array template

(`operator

<

<

(const wchar_t(

&

)[SIZE])`) when handling string literals.

This specialization ensures the array template now correctly processes

literals.

Protected Methods

void FailWithoutStackTrace ()

Call `abort()` or similar to perform `LOG(FATAL)` crash. It is assumed

that the caller has already generated and written the trace as appropriate.

void FailQuietly ()

Similar to `FailWithoutStackTrace()`, but without `abort()`. Terminates

the process with an error exit code.

void SetFailQuietly ()

After this is called, failures are done as quiet as possible for this log

message.

Records

Friends

template <typename T>
class AsStructuredValueImpl
template <StructuredStringType str_type>
class AsStructuredStringTypeImpl
class StringifySink
class AsLiteralImpl