class LogMessage
Defined at line 52 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
Public Methods
LogMessage & InternalStream ()
Don't call this method from outside this library.
Defined at line 104 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
void LogMessage (const char * file, int line, InfoTag )
These constructors are slightly smaller/faster to call; the severity is
curried into the function pointer.
void LogMessage (const char * file, int line, WarningTag )
void LogMessage (const char * file, int line, ErrorTag )
void LogMessage (const LogMessage & )
Defined at line 69 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
void LogMessage (const char * file, int line, absl::LogSeverity severity)
Used for `LOG`.
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 & 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 * sink)
Sends this message to `*sink` in addition to whatever other sinks it would
otherwise have been sent to. `sink` must not be null.
LogMessage & ToSinkOnly (absl::LogSink * sink)
Sends this message to `*sink` and no others. `sink` must not be null.
LogMessage & operator<< (const std::string & v)
These overloads are more efficient since no `ostream` is involved.
LogMessage & operator<< (absl::string_view v)
LogMessage & operator<< (std::ostream &(*)(std::ostream &) m)
Handle stream manipulators e.g. std::endl.
LogMessage & operator<< (std::ios_base &(*)(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 overload for
`char[]` 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 304 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
template <int SIZE>
LogMessage & operator<< (char (&)[SIZE] buf)
Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE`
Defined at line 311 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
template <typename T, typename std::enable_if<absl::HasAbslStringify<T>::value,
int>::type = 0>
LogMessage & operator<< (const T & v)
Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE`
Defined at line 287 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
template <typename T, typename std::enable_if<!absl::HasAbslStringify<T>::value,
int>::type = 0>
LogMessage & operator<< (const T & v)
Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE`
Defined at line 297 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator= (const LogMessage & )
Defined at line 70 of file ../../third_party/abseil-cpp/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).
clang-format off
The CUDA toolchain cannot handle these
<
<
<
's:
Defined at line 110 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (signed char v)
Defined at line 111 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (unsigned char v)
Defined at line 112 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (short v)
Defined at line 115 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (int v)
Defined at line 118 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (long v)
Defined at line 119 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (long long v)
Defined at line 122 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (unsigned short v)
Defined at line 125 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (unsigned int v)
Defined at line 128 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (unsigned long v)
Defined at line 131 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (unsigned long long v)
Defined at line 134 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (void * v)
Defined at line 137 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (const void * v)
Defined at line 138 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (float v)
Defined at line 139 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (double v)
Defined at line 140 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
LogMessage & operator<< (bool v)
Defined at line 141 of file ../../third_party/abseil-cpp/absl/log/internal/log_message.h
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 Flush ()
Dispatches the completed `absl::LogEntry` to applicable `absl::LogSink`s.
This might as well be inlined into `~LogMessage` except that
`~LogMessageFatal` needs to call it early.
void SetFailQuietly ()
After this is called, failures are done as quiet as possible for this log
message.
Records
Friends
class StringifySink
class AsLiteralImpl