Go to the documentation of this file.
19 #ifndef ABSL_BASE_INTERNAL_RAW_LOGGING_H_
20 #define ABSL_BASE_INTERNAL_RAW_LOGGING_H_
24 #include "absl/base/attributes.h"
25 #include "absl/base/config.h"
26 #include "absl/base/internal/atomic_hook.h"
27 #include "absl/base/log_severity.h"
28 #include "absl/base/macros.h"
29 #include "absl/base/optimization.h"
30 #include "absl/base/port.h"
44 #define ABSL_RAW_LOG(severity, ...) \
46 constexpr const char* absl_raw_logging_internal_basename = \
47 ::absl::raw_logging_internal::Basename(__FILE__, \
48 sizeof(__FILE__) - 1); \
49 ::absl::raw_logging_internal::RawLog(ABSL_RAW_LOGGING_INTERNAL_##severity, \
50 absl_raw_logging_internal_basename, \
51 __LINE__, __VA_ARGS__); \
59 #define ABSL_RAW_CHECK(condition, message) \
61 if (ABSL_PREDICT_FALSE(!(condition))) { \
62 ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
75 #define ABSL_INTERNAL_LOG(severity, message) \
77 constexpr const char* absl_raw_logging_internal_filename = __FILE__; \
78 ::absl::raw_logging_internal::internal_log_function( \
79 ABSL_RAW_LOGGING_INTERNAL_##severity, \
80 absl_raw_logging_internal_filename, __LINE__, message); \
81 if (ABSL_RAW_LOGGING_INTERNAL_##severity == ::absl::LogSeverity::kFatal) \
82 ABSL_INTERNAL_UNREACHABLE; \
85 #define ABSL_INTERNAL_CHECK(condition, message) \
87 if (ABSL_PREDICT_FALSE(!(condition))) { \
88 std::string death_message = "Check " #condition " failed: "; \
89 death_message += std::string(message); \
90 ABSL_INTERNAL_LOG(FATAL, death_message); \
94 #define ABSL_RAW_LOGGING_INTERNAL_INFO ::absl::LogSeverity::kInfo
95 #define ABSL_RAW_LOGGING_INTERNAL_WARNING ::absl::LogSeverity::kWarning
96 #define ABSL_RAW_LOGGING_INTERNAL_ERROR ::absl::LogSeverity::kError
97 #define ABSL_RAW_LOGGING_INTERNAL_FATAL ::absl::LogSeverity::kFatal
98 #define ABSL_RAW_LOGGING_INTERNAL_LEVEL(severity) \
99 ::absl::NormalizeLogSeverity(severity)
103 namespace raw_logging_internal {
168 const char* prefix_end,
const char* buf_end);
196 #endif // ABSL_BASE_INTERNAL_RAW_LOGGING_H_
void RegisterAbortHook(AbortHook func)
void AsyncSignalSafeWriteToStderr(const char *s, size_t len)
const grpc_generator::File * file
#define ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES
void(*)(absl::LogSeverity severity, const char *file, int line, const std::string &message) InternalLogFunction
#define ABSL_NAMESPACE_END
bool(*)(absl::LogSeverity severity, const char *file, int line, char **buf, int *buf_size) LogFilterAndPrefixHook
void(*)(const char *file, int line, const char *buf_start, const char *prefix_end, const char *buf_end) AbortHook
void RegisterLogFilterAndPrefixHook(LogFilterAndPrefixHook func)
#define ABSL_NAMESPACE_BEGIN
void RawLog(absl::LogSeverity severity, const char *file, int line, const char *format,...)
#define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check)
void RegisterInternalLogFunction(InternalLogFunction func)
ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_DLL base_internal::AtomicHook< InternalLogFunction > internal_log_function
constexpr const char * Basename(const char *fname, int offset)
bool RawLoggingFullySupported()
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:59