14#ifndef OR_TOOLS_BASE_LOGGING_H_
15#define OR_TOOLS_BASE_LOGGING_H_
27#if defined(__GNUC__) && defined(__linux__)
40#define QCHECK_EQ CHECK_EQ
41#define ABSL_DIE_IF_NULL CHECK_NOTNULL
42#define CHECK_OK(x) CHECK((x).ok())
43#define QCHECK_OK CHECK_OK
49#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) \
50 __pragma(warning(push)) __pragma(warning(disable : n))
51#define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
52#define ATTRIBUTE_NOINLINE
53#define ATTRIBUTE_NORETURN __declspec(noreturn)
55#define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
56#define GLOG_MSVC_POP_WARNING()
57#define ATTRIBUTE_NOINLINE __attribute__((noinline))
58#define ATTRIBUTE_NORETURN __attribute__((noreturn))
70#ifndef GOOGLE_STRIP_LOG
71#define GOOGLE_STRIP_LOG 0
79#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN
81#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0))
83#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x
87#ifndef GOOGLE_PREDICT_FALSE
89#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0))
91#define GOOGLE_PREDICT_FALSE(x) x
95#ifndef GOOGLE_PREDICT_TRUE
97#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
99#define GOOGLE_PREDICT_TRUE(x) x
302#if GOOGLE_STRIP_LOG == 0
303#define COMPACT_GOOGLE_LOG_INFO google::LogMessage(__FILE__, __LINE__)
304#define LOG_TO_STRING_INFO(message) \
305 google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, message)
307#define COMPACT_GOOGLE_LOG_INFO google::NullStream()
308#define LOG_TO_STRING_INFO(message) google::NullStream()
311#if GOOGLE_STRIP_LOG <= 1
312#define COMPACT_GOOGLE_LOG_WARNING \
313 google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING)
314#define LOG_TO_STRING_WARNING(message) \
315 google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, message)
317#define COMPACT_GOOGLE_LOG_WARNING google::NullStream()
318#define LOG_TO_STRING_WARNING(message) google::NullStream()
321#if GOOGLE_STRIP_LOG <= 2
322#define COMPACT_GOOGLE_LOG_ERROR \
323 google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR)
324#define LOG_TO_STRING_ERROR(message) \
325 google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, message)
327#define COMPACT_GOOGLE_LOG_ERROR google::NullStream()
328#define LOG_TO_STRING_ERROR(message) google::NullStream()
331#if GOOGLE_STRIP_LOG <= 3
332#define COMPACT_GOOGLE_LOG_FATAL google::LogMessageFatal(__FILE__, __LINE__)
333#define LOG_TO_STRING_FATAL(message) \
334 google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, message)
336#define COMPACT_GOOGLE_LOG_FATAL google::NullStreamFatal()
337#define LOG_TO_STRING_FATAL(message) google::NullStreamFatal()
340#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
341#define DCHECK_IS_ON() 0
343#define DCHECK_IS_ON() 1
349#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_ERROR
350#elif GOOGLE_STRIP_LOG <= 3
351#define COMPACT_GOOGLE_LOG_DFATAL \
352 google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL)
354#define COMPACT_GOOGLE_LOG_DFATAL google::NullStreamFatal()
357#define GOOGLE_LOG_INFO(counter) \
358 google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, \
359 &google::LogMessage::SendToLog)
360#define SYSLOG_INFO(counter) \
361 google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, \
362 &google::LogMessage::SendToSyslogAndLog)
363#define GOOGLE_LOG_WARNING(counter) \
364 google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \
365 &google::LogMessage::SendToLog)
366#define SYSLOG_WARNING(counter) \
367 google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \
368 &google::LogMessage::SendToSyslogAndLog)
369#define GOOGLE_LOG_ERROR(counter) \
370 google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \
371 &google::LogMessage::SendToLog)
372#define SYSLOG_ERROR(counter) \
373 google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \
374 &google::LogMessage::SendToSyslogAndLog)
375#define GOOGLE_LOG_FATAL(counter) \
376 google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \
377 &google::LogMessage::SendToLog)
378#define SYSLOG_FATAL(counter) \
379 google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \
380 &google::LogMessage::SendToSyslogAndLog)
381#define GOOGLE_LOG_DFATAL(counter) \
382 google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \
383 &google::LogMessage::SendToLog)
384#define SYSLOG_DFATAL(counter) \
385 google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \
386 &google::LogMessage::SendToSyslogAndLog)
388#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || \
389 defined(__CYGWIN__) || defined(__CYGWIN32__)
391#define LOG_SYSRESULT(result) \
392 if (FAILED(HRESULT_FROM_WIN32(result))) { \
393 LPSTR message = NULL; \
394 LPSTR msg = reinterpret_cast<LPSTR>(&message); \
395 DWORD message_length = FormatMessageA( \
396 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, \
397 result, 0, msg, 100, NULL); \
398 if (message_length > 0) { \
399 google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, 0, \
400 &google::LogMessage::SendToLog) \
402 << reinterpret_cast<const char*>(message); \
403 LocalFree(message); \
416#define LOG(severity) COMPACT_GOOGLE_LOG_##severity.stream()
417#define SYSLOG(severity) SYSLOG_##severity(0).stream()
441#define LOG_TO_SINK(sink, severity) \
442 google::LogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
443 static_cast<google::LogSink*>(sink), true) \
445#define LOG_TO_SINK_BUT_NOT_TO_LOGFILE(sink, severity) \
446 google::LogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
447 static_cast<google::LogSink*>(sink), false) \
460#define LOG_TO_STRING(severity, message) \
461 LOG_TO_STRING_##severity(static_cast<string*>(message)).stream()
471#define LOG_STRING(severity, outvec) \
472 LOG_TO_STRING_##severity(static_cast<std::vector<std::string>*>(outvec)) \
475#define LOG_IF(severity, condition) \
476 static_cast<void>(0), \
477 !(condition) ? (void)0 : google::LogMessageVoidify() & LOG(severity)
478#define SYSLOG_IF(severity, condition) \
479 static_cast<void>(0), \
480 !(condition) ? (void)0 : google::LogMessageVoidify() & SYSLOG(severity)
482#define LOG_ASSERT(condition) \
483 LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition
484#define SYSLOG_ASSERT(condition) \
485 SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition
491#define CHECK(condition) \
492 LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \
493 << "Check failed: " #condition " "
501 operator bool()
const {
552 const signed char& v);
555 const unsigned char& v);
558template <
typename T1,
typename T2>
565 const std::nullptr_t& v);
592 std::ostream* ForVar2();
594 std::string* NewString();
597 std::ostringstream* stream_;
602template <
typename T1,
typename T2>
604 const char* exprtext) {
615#define DEFINE_CHECK_OP_IMPL(name, op) \
616 template <typename T1, typename T2> \
617 inline std::string* name##Impl(const T1& v1, const T2& v2, \
618 const char* exprtext) { \
619 if (GOOGLE_PREDICT_TRUE(v1 op v2)) \
622 return MakeCheckOpString(v1, v2, exprtext); \
624 inline std::string* name##Impl(int v1, int v2, const char* exprtext) { \
625 return name##Impl<int, int>(v1, v2, exprtext); \
638#undef DEFINE_CHECK_OP_IMPL
643#if defined(STATIC_ANALYSIS)
645#define CHECK_OP_LOG(name, op, val1, val2, log) CHECK((val1)op(val2))
656typedef std::string _Check_string;
657#define CHECK_OP_LOG(name, op, val1, val2, log) \
658 while (google::_Check_string* _result = google::Check##name##Impl( \
659 google::GetReferenceableValue(val1), \
660 google::GetReferenceableValue(val2), #val1 " " #op " " #val2)) \
661 log(__FILE__, __LINE__, google::CheckOpString(_result)).stream()
665#define CHECK_OP_LOG(name, op, val1, val2, log) \
666 while (google::CheckOpString _result = google::Check##name##Impl( \
667 google::GetReferenceableValue(val1), \
668 google::GetReferenceableValue(val2), #val1 " " #op " " #val2)) \
669 log(__FILE__, __LINE__, _result).stream()
672#if GOOGLE_STRIP_LOG <= 3
673#define CHECK_OP(name, op, val1, val2) \
674 CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal)
676#define CHECK_OP(name, op, val1, val2) \
677 CHECK_OP_LOG(name, op, val1, val2, google::NullStreamFatal)
698#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2)
699#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2)
700#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2)
701#define CHECK_LT(val1, val2) CHECK_OP(_LT, <, val1, val2)
702#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2)
703#define CHECK_GT(val1, val2) CHECK_OP(_GT, >, val1, val2)
708#define CHECK_NOTNULL(val) \
709 google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val))
713#define DECLARE_CHECK_STROP_IMPL(func, expected) \
714 GOOGLE_GLOG_DLL_DECL std::string* Check##func##expected##Impl( \
715 const char* s1, const char* s2, const char* names);
720#undef DECLARE_CHECK_STROP_IMPL
724#define CHECK_STROP(func, op, expected, s1, s2) \
725 while (google::CheckOpString _result = google::Check##func##expected##Impl( \
726 (s1), (s2), #s1 " " #op " " #s2)) \
727 LOG(FATAL) << *_result.str_
736#define CHECK_STREQ(s1, s2) CHECK_STROP(strcmp, ==, true, s1, s2)
737#define CHECK_STRNE(s1, s2) CHECK_STROP(strcmp, !=, false, s1, s2)
738#define CHECK_STRCASEEQ(s1, s2) CHECK_STROP(strcasecmp, ==, true, s1, s2)
739#define CHECK_STRCASENE(s1, s2) CHECK_STROP(strcasecmp, !=, false, s1, s2)
741#define CHECK_INDEX(I, A) CHECK(I < (sizeof(A) / sizeof(A[0])))
742#define CHECK_BOUND(B, A) CHECK(B <= (sizeof(A) / sizeof(A[0])))
744#define CHECK_DOUBLE_EQ(val1, val2) \
746 CHECK_LE((val1), (val2) + 0.000000000000001L); \
747 CHECK_GE((val1), (val2)-0.000000000000001L); \
750#define CHECK_NEAR(val1, val2, margin) \
752 CHECK_LE((val1), (val2) + (margin)); \
753 CHECK_GE((val1), (val2) - (margin)); \
762#define PLOG(severity) GOOGLE_PLOG(severity, 0).stream()
764#define GOOGLE_PLOG(severity, counter) \
765 google::ErrnoLogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
766 counter, &google::LogMessage::SendToLog)
768#define PLOG_IF(severity, condition) \
769 static_cast<void>(0), \
770 !(condition) ? (void)0 : google::LogMessageVoidify() & PLOG(severity)
775#define PCHECK(condition) \
776 PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \
777 << "Check failed: " #condition " "
787#define CHECK_ERR(invocation) \
788 PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN((invocation) == -1)) \
793#define LOG_EVERY_N_VARNAME(base, line) LOG_EVERY_N_VARNAME_CONCAT(base, line)
794#define LOG_EVERY_N_VARNAME_CONCAT(base, line) base##line
796#define LOG_OCCURRENCES LOG_EVERY_N_VARNAME(occurrences_, __LINE__)
797#define LOG_OCCURRENCES_MOD_N LOG_EVERY_N_VARNAME(occurrences_mod_n_, __LINE__)
799#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \
800 static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \
802 if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \
803 if (LOG_OCCURRENCES_MOD_N == 1) \
804 google::LogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
805 LOG_OCCURRENCES, &what_to_do) \
808#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \
809 static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \
812 ((LOG_OCCURRENCES_MOD_N = (LOG_OCCURRENCES_MOD_N + 1) % n) == (1 % n))) \
813 google::LogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
814 LOG_OCCURRENCES, &what_to_do) \
817#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \
818 static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \
820 if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \
821 if (LOG_OCCURRENCES_MOD_N == 1) \
822 google::ErrnoLogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
823 LOG_OCCURRENCES, &what_to_do) \
826#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \
827 static int LOG_OCCURRENCES = 0; \
828 if (LOG_OCCURRENCES <= n) ++LOG_OCCURRENCES; \
829 if (LOG_OCCURRENCES <= n) \
830 google::LogMessage(__FILE__, __LINE__, google::GLOG_##severity, \
831 LOG_OCCURRENCES, &what_to_do) \
834namespace logging_internal {
840#define LOG_EVERY_N(severity, n) \
841 SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog)
843#define SYSLOG_EVERY_N(severity, n) \
844 SOME_KIND_OF_LOG_EVERY_N(severity, (n), \
845 google::LogMessage::SendToSyslogAndLog)
847#define PLOG_EVERY_N(severity, n) \
848 SOME_KIND_OF_PLOG_EVERY_N(severity, (n), google::LogMessage::SendToLog)
850#define LOG_FIRST_N(severity, n) \
851 SOME_KIND_OF_LOG_FIRST_N(severity, (n), google::LogMessage::SendToLog)
853#define LOG_IF_EVERY_N(severity, condition, n) \
854 SOME_KIND_OF_LOG_IF_EVERY_N(severity, (condition), (n), \
855 google::LogMessage::SendToLog)
865#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR
866#define SYSLOG_0 SYSLOG_ERROR
867#define LOG_TO_STRING_0 LOG_TO_STRING_ERROR
876#define DLOG(severity) LOG(severity)
877#define DVLOG(verboselevel) VLOG(verboselevel)
878#define DLOG_IF(severity, condition) LOG_IF(severity, condition)
879#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n)
880#define DLOG_IF_EVERY_N(severity, condition, n) \
881 LOG_IF_EVERY_N(severity, condition, n)
882#define DLOG_ASSERT(condition) LOG_ASSERT(condition)
885#define DCHECK(condition) CHECK(condition)
886#define DCHECK_EQ(val1, val2) CHECK_EQ(val1, val2)
887#define DCHECK_NE(val1, val2) CHECK_NE(val1, val2)
888#define DCHECK_LE(val1, val2) CHECK_LE(val1, val2)
889#define DCHECK_LT(val1, val2) CHECK_LT(val1, val2)
890#define DCHECK_GE(val1, val2) CHECK_GE(val1, val2)
891#define DCHECK_GT(val1, val2) CHECK_GT(val1, val2)
892#define DCHECK_NOTNULL(val) CHECK_NOTNULL(val)
893#define DCHECK_STREQ(str1, str2) CHECK_STREQ(str1, str2)
894#define DCHECK_STRCASEEQ(str1, str2) CHECK_STRCASEEQ(str1, str2)
895#define DCHECK_STRNE(str1, str2) CHECK_STRNE(str1, str2)
896#define DCHECK_STRCASENE(str1, str2) CHECK_STRCASENE(str1, str2)
900#define DLOG(severity) \
901 static_cast<void>(0), \
902 true ? (void)0 : google::LogMessageVoidify() & LOG(severity)
904#define DVLOG(verboselevel) \
905 static_cast<void>(0), (true || !VLOG_IS_ON(verboselevel)) \
907 : google::LogMessageVoidify() & LOG(INFO)
909#define DLOG_IF(severity, condition) \
910 static_cast<void>(0), (true || !(condition)) \
912 : google::LogMessageVoidify() & LOG(severity)
914#define DLOG_EVERY_N(severity, n) \
915 static_cast<void>(0), \
916 true ? (void)0 : google::LogMessageVoidify() & LOG(severity)
918#define DLOG_IF_EVERY_N(severity, condition, n) \
919 static_cast<void>(0), (true || !(condition)) \
921 : google::LogMessageVoidify() & LOG(severity)
923#define DLOG_ASSERT(condition) \
924 static_cast<void>(0), true ? (void)0 : LOG_ASSERT(condition)
927#define DCHECK(condition) \
928 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
929 while (false) GLOG_MSVC_POP_WARNING() CHECK(condition)
931#define DCHECK_EQ(val1, val2) \
932 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
933 while (false) GLOG_MSVC_POP_WARNING() CHECK_EQ(val1, val2)
935#define DCHECK_NE(val1, val2) \
936 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
937 while (false) GLOG_MSVC_POP_WARNING() CHECK_NE(val1, val2)
939#define DCHECK_LE(val1, val2) \
940 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
941 while (false) GLOG_MSVC_POP_WARNING() CHECK_LE(val1, val2)
943#define DCHECK_LT(val1, val2) \
944 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
945 while (false) GLOG_MSVC_POP_WARNING() CHECK_LT(val1, val2)
947#define DCHECK_GE(val1, val2) \
948 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
949 while (false) GLOG_MSVC_POP_WARNING() CHECK_GE(val1, val2)
951#define DCHECK_GT(val1, val2) \
952 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
953 while (false) GLOG_MSVC_POP_WARNING() CHECK_GT(val1, val2)
957#define DCHECK_NOTNULL(val) (val)
959#define DCHECK_STREQ(str1, str2) \
960 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
961 while (false) GLOG_MSVC_POP_WARNING() CHECK_STREQ(str1, str2)
963#define DCHECK_STRCASEEQ(str1, str2) \
964 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
965 while (false) GLOG_MSVC_POP_WARNING() CHECK_STRCASEEQ(str1, str2)
967#define DCHECK_STRNE(str1, str2) \
968 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
969 while (false) GLOG_MSVC_POP_WARNING() CHECK_STRNE(str1, str2)
971#define DCHECK_STRCASENE(str1, str2) \
972 GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \
973 while (false) GLOG_MSVC_POP_WARNING() CHECK_STRCASENE(str1, str2)
979#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel))
981#define VLOG_EVERY_N(verboselevel, n) \
982 LOG_IF_EVERY_N(INFO, VLOG_IS_ON(verboselevel), n)
984namespace base_logging {
995 virtual int_type
overflow(int_type ch) {
return ch; }
998 size_t pcount()
const {
return pptr() - pbase(); }
999 char*
pbase()
const {
return std::streambuf::pbase(); }
1035 :
std::ostream(NULL), streambuf_(buf, len), ctr_(ctr), self_(this) {
1039 int ctr()
const {
return ctr_; }
1044 size_t pcount()
const {
return streambuf_.pcount(); }
1045 char*
pbase()
const {
return streambuf_.pbase(); }
1046 char*
str()
const {
return pbase(); }
1061 SendMethod send_method);
1084 bool also_send_to_log);
1090 std::vector<std::string>* outvec);
1115 void SendToSyslogAndLog();
1120 std::ostream& stream();
1122 int preserved_errno()
const;
1125 static int64_t num_messages(
int severity);
1131 void SendToSinkAndLog();
1135 void WriteToStringAndLog();
1137 void SaveOrSendToLog();
1171inline void LogAtLevel(
int const severity, std::string
const& msg) {
1179#define LOG_AT_LEVEL(severity) \
1180 google::LogMessage(__FILE__, __LINE__, severity).stream()
1191#if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L || \
1192 (defined(_MSC_VER) && _MSC_VER >= 1900))
1201template <
typename T>
1204 LogMessageFatal(
file, line,
new std::string(names));
1206 return std::forward<T>(t);
1212template <
typename T>
1268 const char* base_filename);
1277 const char* symlink_basename);
1292 const char* base_filename,
int line,
1293 const struct ::tm* tm_time,
const char*
message,
1294 size_t message_len) = 0;
1309 virtual void WaitTillSent();
1314 const struct ::tm* tm_time,
const char*
message,
1315 size_t message_len);
1329 const char* filename_extension);
1354 std::vector<std::string>* list);
1390 virtual void Write(
bool force_flush, time_t timestamp,
const char*
message,
1391 int message_len) = 0;
1441 :
LogMessage::LogStream(message_buffer_, 1, 0) {}
1448 char message_buffer_[2];
#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x)
std::ostream & operator<<(std::ostream &out, const google::DummyClassToDefineOperator &)
#define ATTRIBUTE_NOINLINE
#define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
ABSL_DECLARE_FLAG(bool, logtostderr)
#define DECLARE_CHECK_STROP_IMPL(func, expected)
void FixFlagsAndEnvironmentForSwig()
#define GLOG_MSVC_POP_WARNING()
#define ATTRIBUTE_NORETURN
LogStream(char *buf, int len, int ctr)
static const size_t kMaxLogMessageLen
void operator&(std::ostream &)
virtual void send(LogSeverity severity, const char *full_filename, const char *base_filename, int line, const struct ::tm *tm_time, const char *message, size_t message_len)=0
ATTRIBUTE_NORETURN ~NullStreamFatal()
NullStreamFatal(const char *file, int line, const CheckOpString &result)
NullStream(const char *, int, const CheckOpString &)
std::string * NewString()
virtual uint32_t LogSize()=0
virtual void Write(bool force_flush, time_t timestamp, const char *message, int message_len)=0
virtual int_type overflow(int_type ch)
LogStreamBuf(char *buf, int len)
#define GOOGLE_GLOG_DLL_DECL
LogSeverity NormalizeSeverity(LogSeverity s)
GOOGLE_GLOG_DLL_DECL Logger * GetLogger(LogSeverity level)
GOOGLE_GLOG_DLL_DECL void SetLogger(LogSeverity level, Logger *logger)
ostream & operator<<(ostream &os, const PRIVATE_Counter &)
void InitGoogleLogging(const char *argv0)
void FlushLogFilesUnsafe(LogSeverity min_severity)
const T & GetReferenceableValue(const T &t)
T * CheckNotNull(const char *file, int line, const char *names, T *t)
void SetLogFilenameExtension(const char *ext)
void SetLogDestination(LogSeverity severity, const char *base_filename)
void SetStderrLogging(LogSeverity min_severity)
void LogAtLevel(int const severity, std::string const &msg)
const char * GetLogSeverityName(LogSeverity severity)
void GetExistingTempDirectories(vector< string > *list)
void MakeCheckOpValueString(std::ostream *os, const char &v)
void ShutdownGoogleLogging()
void InstallFailureFunction(void(*fail_func)())
int posix_strerror_r(int err, char *buf, size_t len)
const vector< string > & GetLoggingDirectories()
void SetLogSymlink(LogSeverity severity, const char *symlink_basename)
void AddLogSink(LogSink *destination)
void FlushLogFiles(LogSeverity min_severity)
void TestOnly_ClearLoggingDirectoriesList()
std::string * MakeCheckOpString(const T1 &v1, const T2 &v2, const char *exprtext) ATTRIBUTE_NOINLINE
DEFINE_CHECK_OP_IMPL(Check_EQ,==) DEFINE_CHECK_OP_IMPL(Check_NE
void RemoveLogSink(LogSink *destination)
void ReprintFatalMessage()
const absl::string_view ToString(MPSolver::OptimizationProblemType optimization_problem_type)
CheckOpString(std::string *str)