Auto update

This commit is contained in:
Fcitx5 Android Bot 2024-04-09 07:33:50 +00:00
parent 67a260f5bc
commit 96135a6fe7
57 changed files with 4865 additions and 4717 deletions

View file

@ -0,0 +1,191 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_FLAGS_H
#define GLOG_FLAGS_H
#include <string>
#if defined(GLOG_USE_GFLAGS)
# include <gflags/gflags.h>
#endif
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/flags.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/platform.h"
#include "glog/types.h"
#pragma push_macro("DECLARE_VARIABLE")
#pragma push_macro("DECLARE_bool")
#pragma push_macro("DECLARE_string")
#pragma push_macro("DECLARE_int32")
#pragma push_macro("DECLARE_uint32")
#ifdef DECLARE_VARIABLE
# undef DECLARE_VARIABLE
#endif
#ifdef DECLARE_bool
# undef DECLARE_bool
#endif
#ifdef DECLARE_string
# undef DECLARE_string
#endif
#ifdef DECLARE_int32
# undef DECLARE_int32
#endif
#ifdef DECLARE_uint32
# undef DECLARE_uint32
#endif
#ifndef DECLARE_VARIABLE
# define DECLARE_VARIABLE(type, shorttype, name, tn) \
namespace fL##shorttype { \
extern GLOG_EXPORT type FLAGS_##name; \
} \
using fL##shorttype::FLAGS_##name
// bool specialization
# define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name, bool)
// int32 specialization
# define DECLARE_int32(name) DECLARE_VARIABLE(google::int32, I, name, int32)
# if !defined(DECLARE_uint32)
// uint32 specialization
# define DECLARE_uint32(name) \
DECLARE_VARIABLE(google::uint32, U, name, uint32)
# endif // !defined(DECLARE_uint32) && !defined(GLOG_USE_GFLAGS)
// Special case for string, because we have to specify the namespace
// std::string, which doesn't play nicely with our FLAG__namespace hackery.
# define DECLARE_string(name) \
namespace fLS { \
extern GLOG_EXPORT std::string& FLAGS_##name; \
} \
using fLS::FLAGS_##name
#endif
DECLARE_int32(logemaillevel);
DECLARE_int32(logcleansecs);
#ifdef GLOG_OS_LINUX
DECLARE_bool(drop_log_memory);
#endif
DECLARE_string(alsologtoemail);
DECLARE_string(log_backtrace_at);
// Set whether appending a timestamp to the log file name
DECLARE_bool(timestamp_in_logfile_name);
// Set whether log messages go to stdout instead of logfiles
DECLARE_bool(logtostdout);
// Set color messages logged to stdout (if supported by terminal).
DECLARE_bool(colorlogtostdout);
// Set whether log messages go to stderr instead of logfiles
DECLARE_bool(logtostderr);
// Set whether log messages go to stderr in addition to logfiles.
DECLARE_bool(alsologtostderr);
// Set color messages logged to stderr (if supported by terminal).
DECLARE_bool(colorlogtostderr);
// Log messages at a level >= this flag are automatically sent to
// stderr in addition to log files.
DECLARE_int32(stderrthreshold);
// Set whether the log file header should be written upon creating a file.
DECLARE_bool(log_file_header);
// Set whether the log prefix should be prepended to each line of output.
DECLARE_bool(log_prefix);
// Set whether the year should be included in the log prefix.
DECLARE_bool(log_year_in_prefix);
// Log messages at a level <= this flag are buffered.
// Log messages at a higher level are flushed immediately.
DECLARE_int32(logbuflevel);
// Sets the maximum number of seconds which logs may be buffered for.
DECLARE_int32(logbufsecs);
// Log suppression level: messages logged at a lower level than this
// are suppressed.
DECLARE_int32(minloglevel);
// If specified, logfiles are written into this directory instead of the
// default logging directory.
DECLARE_string(log_dir);
// Set the log file mode.
DECLARE_int32(logfile_mode);
// Sets the path of the directory into which to put additional links
// to the log files.
DECLARE_string(log_link);
DECLARE_int32(v); // in vlog_is_on.cc
DECLARE_string(vmodule); // also in vlog_is_on.cc
// Sets the maximum log file size (in MB).
DECLARE_uint32(max_log_size);
// Sets whether to avoid logging to the disk if the disk is full.
DECLARE_bool(stop_logging_if_full_disk);
// Use UTC time for logging
DECLARE_bool(log_utc_time);
// Mailer used to send logging email
DECLARE_string(logmailer);
DECLARE_bool(symbolize_stacktrace);
#pragma pop_macro("DECLARE_VARIABLE")
#pragma pop_macro("DECLARE_bool")
#pragma pop_macro("DECLARE_string")
#pragma pop_macro("DECLARE_int32")
#pragma pop_macro("DECLARE_uint32")
#endif // GLOG_FLAGS_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -30,6 +30,16 @@
#ifndef BASE_LOG_SEVERITY_H__ #ifndef BASE_LOG_SEVERITY_H__
#define BASE_LOG_SEVERITY_H__ #define BASE_LOG_SEVERITY_H__
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
#endif
namespace google {
// The recommended semantics of the log levels are as follows: // The recommended semantics of the log levels are as follows:
// //
// INFO: // INFO:
@ -48,17 +58,35 @@
// Variables of type LogSeverity are widely taken to lie in the range // Variables of type LogSeverity are widely taken to lie in the range
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
// you ever need to change their values or add a new severity. // you ever need to change their values or add a new severity.
typedef int LogSeverity;
const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, enum LogSeverity {
NUM_SEVERITIES = 4; GLOG_INFO = 0,
GLOG_WARNING = 1,
GLOG_ERROR = 2,
GLOG_FATAL = 3,
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES #ifndef GLOG_NO_ABBREVIATED_SEVERITIES
# ifdef ERROR # ifdef ERROR
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
# endif # endif
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, INFO = GLOG_INFO,
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; WARNING = GLOG_WARNING,
ERROR = GLOG_ERROR,
FATAL = GLOG_FATAL
#endif #endif
};
#if defined(__cpp_inline_variables)
# if (__cpp_inline_variables >= 201606L)
# define GLOG_INLINE_VARIABLE inline
# endif // (__cpp_inline_variables >= 201606L)
#endif // defined(__cpp_inline_variables)
#if !defined(GLOG_INLINE_VARIABLE)
# define GLOG_INLINE_VARIABLE
#endif // !defined(GLOG_INLINE_VARIABLE)
GLOG_INLINE_VARIABLE
constexpr int NUM_SEVERITIES = 4;
// DFATAL is FATAL in debug mode, ERROR in normal mode // DFATAL is FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG #ifdef NDEBUG
@ -67,8 +95,6 @@ const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
# define DFATAL_LEVEL FATAL # define DFATAL_LEVEL FATAL
#endif #endif
extern GLOG_EXPORT const char* const LogSeverityNames[NUM_SEVERITIES];
// NDEBUG usage helpers related to (RAW_)DCHECK: // NDEBUG usage helpers related to (RAW_)DCHECK:
// //
// DEBUG_MODE is for small !NDEBUG uses like // DEBUG_MODE is for small !NDEBUG uses like
@ -95,4 +121,6 @@ enum { DEBUG_MODE = 1 };
# define IF_DEBUG_MODE(x) x # define IF_DEBUG_MODE(x) x
#endif #endif
} // namespace google
#endif // BASE_LOG_SEVERITY_H__ #endif // BASE_LOG_SEVERITY_H__

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright (c) 2008, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -42,6 +42,9 @@
# ifndef GLOG_OS_LINUX # ifndef GLOG_OS_LINUX
# define GLOG_OS_LINUX # define GLOG_OS_LINUX
# endif # endif
# if defined(__ANDROID__)
# define GLOG_OS_ANDROID
# endif
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
# define GLOG_OS_MACOSX # define GLOG_OS_MACOSX
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
@ -50,7 +53,8 @@
# define GLOG_OS_NETBSD # define GLOG_OS_NETBSD
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
# define GLOG_OS_OPENBSD # define GLOG_OS_OPENBSD
#else #elif defined(__EMSCRIPTEN__)
# define GLOG_OS_EMSCRIPTEN
// TODO(hamaji): Add other platforms. // TODO(hamaji): Add other platforms.
#error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github. #error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github.
#endif #endif

View file

@ -1,4 +1,4 @@
// Copyright (c) 2006, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -36,19 +36,19 @@
#ifndef GLOG_RAW_LOGGING_H #ifndef GLOG_RAW_LOGGING_H
#define GLOG_RAW_LOGGING_H #define GLOG_RAW_LOGGING_H
#include <ctime> #if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/raw_logging.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
namespace google { namespace google {
#include <glog/log_severity.h>
#include <glog/logging.h>
#include <glog/vlog_is_on.h>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
// This is similar to LOG(severity) << format... and VLOG(level) << format.., // This is similar to LOG(severity) << format... and VLOG(level) << format..,
// but // but
// * it is to be used ONLY by low-level modules that can't use normal LOG() // * it is to be used ONLY by low-level modules that can't use normal LOG()
@ -97,29 +97,29 @@ namespace google {
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG == 0 #if !defined(STRIP_LOG) || STRIP_LOG == 0
#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ # define RAW_LOG_INFO(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG <= 1 #if !defined(STRIP_LOG) || STRIP_LOG <= 1
#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ # define RAW_LOG_WARNING(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 1 #endif // STRIP_LOG <= 1
#if !defined(STRIP_LOG) || STRIP_LOG <= 2 #if !defined(STRIP_LOG) || STRIP_LOG <= 2
#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ # define RAW_LOG_ERROR(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 2 #endif // STRIP_LOG <= 2
#if !defined(STRIP_LOG) || STRIP_LOG <= 3 #if !defined(STRIP_LOG) || STRIP_LOG <= 3
#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ # define RAW_LOG_FATAL(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_FATAL(...) \ # define RAW_LOG_FATAL(...) \
do { \ do { \
@ -149,22 +149,15 @@ namespace google {
#else // NDEBUG #else // NDEBUG
# define RAW_DLOG(severity, ...) \ # define RAW_DLOG(severity, ...) \
while (false) \ while (false) RAW_LOG(severity, __VA_ARGS__)
RAW_LOG(severity, __VA_ARGS__)
# define RAW_DCHECK(condition, message) \ # define RAW_DCHECK(condition, message) \
while (false) \ while (false) RAW_CHECK(condition, message)
RAW_CHECK(condition, message)
#endif // NDEBUG #endif // NDEBUG
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Stub log function used to work around for unused variable warnings when // Stub log function used to work around for unused variable warnings when
// building with STRIP_LOG > 0. // building with STRIP_LOG > 0.
static inline void RawLogStub__(int /* ignored */, ...) { static inline void RawLogStub__(int /* ignored */, ...) {}
}
// Helper function to implement RAW_LOG and RAW_VLOG // Helper function to implement RAW_LOG and RAW_VLOG
// Logs format... at "severity" level, reporting it // Logs format... at "severity" level, reporting it
@ -172,8 +165,12 @@ static inline void RawLogStub__(int /* ignored */, ...) {
// This does not allocate memory or acquire locks. // This does not allocate memory or acquire locks.
GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line, GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line,
const char* format, ...) const char* format, ...)
__attribute__((__format__(__printf__, 4, 5))); #if defined(__has_attribute)
# if __has_attribute(used)
} __attribute__((__format__(__printf__, 4, 5)))
# endif
#endif
;
} // namespace google
#endif // GLOG_RAW_LOGGING_H #endif // GLOG_RAW_LOGGING_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2003, Google Inc. // Copyright (c) 2023, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -35,47 +35,19 @@
// vector<int> v1, v2; // vector<int> v1, v2;
// CHECK_EQ(v1, v2); // CHECK_EQ(v1, v2);
// //
// If you want to use this header file with hash maps or slist, you
// need to define macros before including this file:
//
// - GLOG_STL_LOGGING_FOR_UNORDERED - <unordered_map> and <unordered_set>
// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - <tr1/unordered_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_HASH - <ext/hash_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_SLIST - <ext/slist>
//
#ifndef UTIL_GTL_STL_LOGGING_INL_H_ #ifndef GLOG_STL_LOGGING_H
#define UTIL_GTL_STL_LOGGING_INL_H_ #define GLOG_STL_LOGGING_H
#if !1
# error We do not support stl_logging for this compiler
#endif
#include <deque> #include <deque>
#include <list> #include <list>
#include <map> #include <map>
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <utility>
#include <vector>
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#endif #include <utility>
#include <vector>
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
# include <tr1/unordered_map>
# include <tr1/unordered_set>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
# include <ext/hash_set>
# include <ext/hash_map>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
# include <ext/slist>
#endif
// Forward declare these two, and define them after all the container streams // Forward declare these two, and define them after all the container streams
// operators so that we can recurse from pair -> container -> container -> pair // operators so that we can recurse from pair -> container -> container -> pair
@ -89,7 +61,6 @@ template<class Iter>
void PrintSequence(std::ostream& out, Iter begin, Iter end); void PrintSequence(std::ostream& out, Iter begin, Iter end);
} }
#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ #define OUTPUT_TWO_ARG_CONTAINER(Sequence) \
template <class T1, class T2> \ template <class T1, class T2> \
inline std::ostream& operator<<(std::ostream& out, \ inline std::ostream& operator<<(std::ostream& out, \
@ -101,10 +72,6 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_TWO_ARG_CONTAINER(std::vector) OUTPUT_TWO_ARG_CONTAINER(std::vector)
OUTPUT_TWO_ARG_CONTAINER(std::deque) OUTPUT_TWO_ARG_CONTAINER(std::deque)
OUTPUT_TWO_ARG_CONTAINER(std::list) OUTPUT_TWO_ARG_CONTAINER(std::list)
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist)
#endif
#undef OUTPUT_TWO_ARG_CONTAINER #undef OUTPUT_TWO_ARG_CONTAINER
#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ #define OUTPUT_THREE_ARG_CONTAINER(Sequence) \
@ -130,19 +97,8 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_FOUR_ARG_CONTAINER(std::map) OUTPUT_FOUR_ARG_CONTAINER(std::map)
OUTPUT_FOUR_ARG_CONTAINER(std::multimap) OUTPUT_FOUR_ARG_CONTAINER(std::multimap)
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set)
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset)
#endif
#undef OUTPUT_FOUR_ARG_CONTAINER #undef OUTPUT_FOUR_ARG_CONTAINER
#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ #define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \
@ -153,18 +109,8 @@ inline std::ostream& operator<<(std::ostream& out, \
return out; \ return out; \
} }
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map)
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap)
#endif
#undef OUTPUT_FIVE_ARG_CONTAINER #undef OUTPUT_FIVE_ARG_CONTAINER
@ -189,7 +135,7 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
} }
} }
} } // namespace google
// Note that this is technically undefined behavior! We are adding things into // Note that this is technically undefined behavior! We are adding things into
// the std namespace for a reason though -- we are providing new operations on // the std namespace for a reason though -- we are providing new operations on
@ -215,6 +161,8 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
// move all of the *definitions* into namespace std, bet we need to ensure no // move all of the *definitions* into namespace std, bet we need to ensure no
// one references them first. This lets us take that step. We cannot define them // one references them first. This lets us take that step. We cannot define them
// in both because that would create ambiguous overloads when both are found. // in both because that would create ambiguous overloads when both are found.
namespace std { using ::operator<<; } namespace std {
using ::operator<<;
}
#endif // UTIL_GTL_STL_LOGGING_INL_H_ #endif // GLOG_STL_LOGGING_H

View file

@ -0,0 +1,81 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_TYPES_H
#define GLOG_TYPES_H
#include <cstddef>
#include <cstdint>
namespace google {
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using int64 = std::int64_t;
using uint64 = std::uint64_t;
} // namespace google
#if defined(__has_feature)
# if __has_feature(thread_sanitizer)
# define GLOG_SANITIZE_THREAD 1
# endif
#endif
#if !defined(GLOG_SANITIZE_THREAD) && defined(__SANITIZE_THREAD__) && \
__SANITIZE_THREAD__
# define GLOG_SANITIZE_THREAD 1
#endif
#if defined(GLOG_SANITIZE_THREAD)
# define GLOG_IFDEF_THREAD_SANITIZER(X) X
#else
# define GLOG_IFDEF_THREAD_SANITIZER(X)
#endif
#if defined(_MSC_VER)
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n) \
__pragma(warning(push)) __pragma(warning(disable : n))
# define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
#else
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
# define GLOG_MSVC_POP_WARNING()
#endif
#if defined(GLOG_SANITIZE_THREAD)
// We need to identify the static variables as "benign" races
// to avoid noisy reports from TSAN.
extern "C" void AnnotateBenignRaceSized(const char* file, int line,
const volatile void* mem, size_t size,
const char* description);
#endif // defined(GLOG_SANITIZE_THREAD)
#endif // GLOG_TYPES_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 1999, 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -58,10 +58,21 @@
// CAVEAT: --vmodule functionality is not available in non gcc compilers. // CAVEAT: --vmodule functionality is not available in non gcc compilers.
// //
#ifndef BASE_VLOG_IS_ON_H_ #ifndef GLOG_VLOG_IS_ON_H
#define BASE_VLOG_IS_ON_H_ #define GLOG_VLOG_IS_ON_H
#include <glog/log_severity.h> #include <cstddef>
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/vlog_is_on.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/flags.h"
#include "glog/types.h"
#if defined(__GNUC__) #if defined(__GNUC__)
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. // We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
@ -71,11 +82,15 @@
// matching the current source file that represents results of // matching the current source file that represents results of
// parsing of --vmodule flag and/or SetVLOGLevel calls. // parsing of --vmodule flag and/or SetVLOGLevel calls.
# define VLOG_IS_ON(verboselevel) \ # define VLOG_IS_ON(verboselevel) \
__extension__ \ __extension__({ \
({ static google::SiteFlag vlocal__ = {NULL, NULL, 0, NULL}; \ static google::SiteFlag vlocal__ = {nullptr, nullptr, 0, nullptr}; \
GLOG_IFDEF_THREAD_SANITIZER(AnnotateBenignRaceSized( \
__FILE__, __LINE__, &vlocal__, sizeof(google::SiteFlag), "")); \
google::int32 verbose_level__ = (verboselevel); \ google::int32 verbose_level__ = (verboselevel); \
(vlocal__.level == NULL ? google::InitVLOG3__(&vlocal__, &FLAGS_v, \ (vlocal__.level == nullptr \
__FILE__, verbose_level__) : *vlocal__.level >= verbose_level__); \ ? google::InitVLOG3__(&vlocal__, &FLAGS_v, __FILE__, \
verbose_level__) \
: *vlocal__.level >= verbose_level__); \
}) })
#else #else
// GNU extensions not available, so we do not support --vmodule. // GNU extensions not available, so we do not support --vmodule.
@ -83,6 +98,8 @@
# define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) # define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
#endif #endif
namespace google {
// Set VLOG(_IS_ON) level for module_pattern to log_level. // Set VLOG(_IS_ON) level for module_pattern to log_level.
// This lets us dynamically control what is normally set by the --vmodule flag. // This lets us dynamically control what is normally set by the --vmodule flag.
// Returns the level that previously applied to module_pattern. // Returns the level that previously applied to module_pattern.
@ -96,13 +113,13 @@ extern GLOG_EXPORT int SetVLOGLevel(const char* module_pattern, int log_level);
// Various declarations needed for VLOG_IS_ON above: ========================= // Various declarations needed for VLOG_IS_ON above: =========================
struct SiteFlag { struct SiteFlag {
google::int32* level; int32* level;
const char* base_name; const char* base_name;
size_t base_len; std::size_t base_len;
SiteFlag* next; SiteFlag* next;
}; };
// Helper routine which determines the logging info for a particalur VLOG site. // Helper routine which determines the logging info for a particular VLOG site.
// site_flag is the address of the site-local pointer to the controlling // site_flag is the address of the site-local pointer to the controlling
// verbosity level // verbosity level
// site_default is the default to use for *site_flag // site_default is the default to use for *site_flag
@ -110,9 +127,10 @@ struct SiteFlag {
// verbose_level is the argument to VLOG_IS_ON // verbose_level is the argument to VLOG_IS_ON
// We will return the return value for VLOG_IS_ON // We will return the return value for VLOG_IS_ON
// and if possible set *site_flag appropriately. // and if possible set *site_flag appropriately.
extern GLOG_EXPORT bool InitVLOG3__( extern GLOG_EXPORT bool InitVLOG3__(SiteFlag* site_flag,
google::SiteFlag* site_flag, int32* site_default,
google::int32* site_default, const char* fname, const char* fname,
google::int32 verbose_level); int32 verbose_level);
} // namespace google
#endif // BASE_VLOG_IS_ON_H_ #endif // GLOG_VLOG_IS_ON_H

View file

@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file(). # The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.6.0") set(PACKAGE_VERSION "0.7.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
else() else()
if("0.6.0" MATCHES "^([0-9]+)\\.") if("0.7.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif() endif()
else() else()
set(CVF_VERSION_MAJOR "0.6.0") set(CVF_VERSION_MAJOR "0.7.0")
endif() endif()
if(PACKAGE_FIND_VERSION_RANGE) if(PACKAGE_FIND_VERSION_RANGE)

View file

@ -21,6 +21,8 @@ endmacro()
include (CMakeFindDependencyMacro) include (CMakeFindDependencyMacro)
include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake)
find_dependency (Threads)

View file

@ -54,9 +54,10 @@ endif()
add_library(glog::glog STATIC IMPORTED) add_library(glog::glog STATIC IMPORTED)
set_target_properties(glog::glog PROPERTIES set_target_properties(glog::glog PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "GLOG_CUSTOM_PREFIX_SUPPORT" INTERFACE_COMPILE_DEFINITIONS "GLOG_USE_GLOG_EXPORT"
INTERFACE_COMPILE_FEATURES "cxx_std_14"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:-pthread>;\$<LINK_ONLY:log>" INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:log>"
) )
if(CMAKE_VERSION VERSION_LESS 2.8.12) if(CMAKE_VERSION VERSION_LESS 2.8.12)

Binary file not shown.

View file

@ -0,0 +1,191 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_FLAGS_H
#define GLOG_FLAGS_H
#include <string>
#if defined(GLOG_USE_GFLAGS)
# include <gflags/gflags.h>
#endif
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/flags.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/platform.h"
#include "glog/types.h"
#pragma push_macro("DECLARE_VARIABLE")
#pragma push_macro("DECLARE_bool")
#pragma push_macro("DECLARE_string")
#pragma push_macro("DECLARE_int32")
#pragma push_macro("DECLARE_uint32")
#ifdef DECLARE_VARIABLE
# undef DECLARE_VARIABLE
#endif
#ifdef DECLARE_bool
# undef DECLARE_bool
#endif
#ifdef DECLARE_string
# undef DECLARE_string
#endif
#ifdef DECLARE_int32
# undef DECLARE_int32
#endif
#ifdef DECLARE_uint32
# undef DECLARE_uint32
#endif
#ifndef DECLARE_VARIABLE
# define DECLARE_VARIABLE(type, shorttype, name, tn) \
namespace fL##shorttype { \
extern GLOG_EXPORT type FLAGS_##name; \
} \
using fL##shorttype::FLAGS_##name
// bool specialization
# define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name, bool)
// int32 specialization
# define DECLARE_int32(name) DECLARE_VARIABLE(google::int32, I, name, int32)
# if !defined(DECLARE_uint32)
// uint32 specialization
# define DECLARE_uint32(name) \
DECLARE_VARIABLE(google::uint32, U, name, uint32)
# endif // !defined(DECLARE_uint32) && !defined(GLOG_USE_GFLAGS)
// Special case for string, because we have to specify the namespace
// std::string, which doesn't play nicely with our FLAG__namespace hackery.
# define DECLARE_string(name) \
namespace fLS { \
extern GLOG_EXPORT std::string& FLAGS_##name; \
} \
using fLS::FLAGS_##name
#endif
DECLARE_int32(logemaillevel);
DECLARE_int32(logcleansecs);
#ifdef GLOG_OS_LINUX
DECLARE_bool(drop_log_memory);
#endif
DECLARE_string(alsologtoemail);
DECLARE_string(log_backtrace_at);
// Set whether appending a timestamp to the log file name
DECLARE_bool(timestamp_in_logfile_name);
// Set whether log messages go to stdout instead of logfiles
DECLARE_bool(logtostdout);
// Set color messages logged to stdout (if supported by terminal).
DECLARE_bool(colorlogtostdout);
// Set whether log messages go to stderr instead of logfiles
DECLARE_bool(logtostderr);
// Set whether log messages go to stderr in addition to logfiles.
DECLARE_bool(alsologtostderr);
// Set color messages logged to stderr (if supported by terminal).
DECLARE_bool(colorlogtostderr);
// Log messages at a level >= this flag are automatically sent to
// stderr in addition to log files.
DECLARE_int32(stderrthreshold);
// Set whether the log file header should be written upon creating a file.
DECLARE_bool(log_file_header);
// Set whether the log prefix should be prepended to each line of output.
DECLARE_bool(log_prefix);
// Set whether the year should be included in the log prefix.
DECLARE_bool(log_year_in_prefix);
// Log messages at a level <= this flag are buffered.
// Log messages at a higher level are flushed immediately.
DECLARE_int32(logbuflevel);
// Sets the maximum number of seconds which logs may be buffered for.
DECLARE_int32(logbufsecs);
// Log suppression level: messages logged at a lower level than this
// are suppressed.
DECLARE_int32(minloglevel);
// If specified, logfiles are written into this directory instead of the
// default logging directory.
DECLARE_string(log_dir);
// Set the log file mode.
DECLARE_int32(logfile_mode);
// Sets the path of the directory into which to put additional links
// to the log files.
DECLARE_string(log_link);
DECLARE_int32(v); // in vlog_is_on.cc
DECLARE_string(vmodule); // also in vlog_is_on.cc
// Sets the maximum log file size (in MB).
DECLARE_uint32(max_log_size);
// Sets whether to avoid logging to the disk if the disk is full.
DECLARE_bool(stop_logging_if_full_disk);
// Use UTC time for logging
DECLARE_bool(log_utc_time);
// Mailer used to send logging email
DECLARE_string(logmailer);
DECLARE_bool(symbolize_stacktrace);
#pragma pop_macro("DECLARE_VARIABLE")
#pragma pop_macro("DECLARE_bool")
#pragma pop_macro("DECLARE_string")
#pragma pop_macro("DECLARE_int32")
#pragma pop_macro("DECLARE_uint32")
#endif // GLOG_FLAGS_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -30,6 +30,16 @@
#ifndef BASE_LOG_SEVERITY_H__ #ifndef BASE_LOG_SEVERITY_H__
#define BASE_LOG_SEVERITY_H__ #define BASE_LOG_SEVERITY_H__
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
#endif
namespace google {
// The recommended semantics of the log levels are as follows: // The recommended semantics of the log levels are as follows:
// //
// INFO: // INFO:
@ -48,17 +58,35 @@
// Variables of type LogSeverity are widely taken to lie in the range // Variables of type LogSeverity are widely taken to lie in the range
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
// you ever need to change their values or add a new severity. // you ever need to change their values or add a new severity.
typedef int LogSeverity;
const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, enum LogSeverity {
NUM_SEVERITIES = 4; GLOG_INFO = 0,
GLOG_WARNING = 1,
GLOG_ERROR = 2,
GLOG_FATAL = 3,
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES #ifndef GLOG_NO_ABBREVIATED_SEVERITIES
# ifdef ERROR # ifdef ERROR
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
# endif # endif
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, INFO = GLOG_INFO,
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; WARNING = GLOG_WARNING,
ERROR = GLOG_ERROR,
FATAL = GLOG_FATAL
#endif #endif
};
#if defined(__cpp_inline_variables)
# if (__cpp_inline_variables >= 201606L)
# define GLOG_INLINE_VARIABLE inline
# endif // (__cpp_inline_variables >= 201606L)
#endif // defined(__cpp_inline_variables)
#if !defined(GLOG_INLINE_VARIABLE)
# define GLOG_INLINE_VARIABLE
#endif // !defined(GLOG_INLINE_VARIABLE)
GLOG_INLINE_VARIABLE
constexpr int NUM_SEVERITIES = 4;
// DFATAL is FATAL in debug mode, ERROR in normal mode // DFATAL is FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG #ifdef NDEBUG
@ -67,8 +95,6 @@ const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
# define DFATAL_LEVEL FATAL # define DFATAL_LEVEL FATAL
#endif #endif
extern GLOG_EXPORT const char* const LogSeverityNames[NUM_SEVERITIES];
// NDEBUG usage helpers related to (RAW_)DCHECK: // NDEBUG usage helpers related to (RAW_)DCHECK:
// //
// DEBUG_MODE is for small !NDEBUG uses like // DEBUG_MODE is for small !NDEBUG uses like
@ -95,4 +121,6 @@ enum { DEBUG_MODE = 1 };
# define IF_DEBUG_MODE(x) x # define IF_DEBUG_MODE(x) x
#endif #endif
} // namespace google
#endif // BASE_LOG_SEVERITY_H__ #endif // BASE_LOG_SEVERITY_H__

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright (c) 2008, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -42,6 +42,9 @@
# ifndef GLOG_OS_LINUX # ifndef GLOG_OS_LINUX
# define GLOG_OS_LINUX # define GLOG_OS_LINUX
# endif # endif
# if defined(__ANDROID__)
# define GLOG_OS_ANDROID
# endif
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
# define GLOG_OS_MACOSX # define GLOG_OS_MACOSX
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
@ -50,7 +53,8 @@
# define GLOG_OS_NETBSD # define GLOG_OS_NETBSD
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
# define GLOG_OS_OPENBSD # define GLOG_OS_OPENBSD
#else #elif defined(__EMSCRIPTEN__)
# define GLOG_OS_EMSCRIPTEN
// TODO(hamaji): Add other platforms. // TODO(hamaji): Add other platforms.
#error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github. #error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github.
#endif #endif

View file

@ -1,4 +1,4 @@
// Copyright (c) 2006, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -36,19 +36,19 @@
#ifndef GLOG_RAW_LOGGING_H #ifndef GLOG_RAW_LOGGING_H
#define GLOG_RAW_LOGGING_H #define GLOG_RAW_LOGGING_H
#include <ctime> #if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/raw_logging.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
namespace google { namespace google {
#include <glog/log_severity.h>
#include <glog/logging.h>
#include <glog/vlog_is_on.h>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
// This is similar to LOG(severity) << format... and VLOG(level) << format.., // This is similar to LOG(severity) << format... and VLOG(level) << format..,
// but // but
// * it is to be used ONLY by low-level modules that can't use normal LOG() // * it is to be used ONLY by low-level modules that can't use normal LOG()
@ -97,29 +97,29 @@ namespace google {
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG == 0 #if !defined(STRIP_LOG) || STRIP_LOG == 0
#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ # define RAW_LOG_INFO(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG <= 1 #if !defined(STRIP_LOG) || STRIP_LOG <= 1
#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ # define RAW_LOG_WARNING(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 1 #endif // STRIP_LOG <= 1
#if !defined(STRIP_LOG) || STRIP_LOG <= 2 #if !defined(STRIP_LOG) || STRIP_LOG <= 2
#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ # define RAW_LOG_ERROR(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 2 #endif // STRIP_LOG <= 2
#if !defined(STRIP_LOG) || STRIP_LOG <= 3 #if !defined(STRIP_LOG) || STRIP_LOG <= 3
#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ # define RAW_LOG_FATAL(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_FATAL(...) \ # define RAW_LOG_FATAL(...) \
do { \ do { \
@ -149,22 +149,15 @@ namespace google {
#else // NDEBUG #else // NDEBUG
# define RAW_DLOG(severity, ...) \ # define RAW_DLOG(severity, ...) \
while (false) \ while (false) RAW_LOG(severity, __VA_ARGS__)
RAW_LOG(severity, __VA_ARGS__)
# define RAW_DCHECK(condition, message) \ # define RAW_DCHECK(condition, message) \
while (false) \ while (false) RAW_CHECK(condition, message)
RAW_CHECK(condition, message)
#endif // NDEBUG #endif // NDEBUG
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Stub log function used to work around for unused variable warnings when // Stub log function used to work around for unused variable warnings when
// building with STRIP_LOG > 0. // building with STRIP_LOG > 0.
static inline void RawLogStub__(int /* ignored */, ...) { static inline void RawLogStub__(int /* ignored */, ...) {}
}
// Helper function to implement RAW_LOG and RAW_VLOG // Helper function to implement RAW_LOG and RAW_VLOG
// Logs format... at "severity" level, reporting it // Logs format... at "severity" level, reporting it
@ -172,8 +165,12 @@ static inline void RawLogStub__(int /* ignored */, ...) {
// This does not allocate memory or acquire locks. // This does not allocate memory or acquire locks.
GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line, GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line,
const char* format, ...) const char* format, ...)
__attribute__((__format__(__printf__, 4, 5))); #if defined(__has_attribute)
# if __has_attribute(used)
} __attribute__((__format__(__printf__, 4, 5)))
# endif
#endif
;
} // namespace google
#endif // GLOG_RAW_LOGGING_H #endif // GLOG_RAW_LOGGING_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2003, Google Inc. // Copyright (c) 2023, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -35,47 +35,19 @@
// vector<int> v1, v2; // vector<int> v1, v2;
// CHECK_EQ(v1, v2); // CHECK_EQ(v1, v2);
// //
// If you want to use this header file with hash maps or slist, you
// need to define macros before including this file:
//
// - GLOG_STL_LOGGING_FOR_UNORDERED - <unordered_map> and <unordered_set>
// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - <tr1/unordered_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_HASH - <ext/hash_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_SLIST - <ext/slist>
//
#ifndef UTIL_GTL_STL_LOGGING_INL_H_ #ifndef GLOG_STL_LOGGING_H
#define UTIL_GTL_STL_LOGGING_INL_H_ #define GLOG_STL_LOGGING_H
#if !1
# error We do not support stl_logging for this compiler
#endif
#include <deque> #include <deque>
#include <list> #include <list>
#include <map> #include <map>
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <utility>
#include <vector>
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#endif #include <utility>
#include <vector>
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
# include <tr1/unordered_map>
# include <tr1/unordered_set>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
# include <ext/hash_set>
# include <ext/hash_map>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
# include <ext/slist>
#endif
// Forward declare these two, and define them after all the container streams // Forward declare these two, and define them after all the container streams
// operators so that we can recurse from pair -> container -> container -> pair // operators so that we can recurse from pair -> container -> container -> pair
@ -89,7 +61,6 @@ template<class Iter>
void PrintSequence(std::ostream& out, Iter begin, Iter end); void PrintSequence(std::ostream& out, Iter begin, Iter end);
} }
#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ #define OUTPUT_TWO_ARG_CONTAINER(Sequence) \
template <class T1, class T2> \ template <class T1, class T2> \
inline std::ostream& operator<<(std::ostream& out, \ inline std::ostream& operator<<(std::ostream& out, \
@ -101,10 +72,6 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_TWO_ARG_CONTAINER(std::vector) OUTPUT_TWO_ARG_CONTAINER(std::vector)
OUTPUT_TWO_ARG_CONTAINER(std::deque) OUTPUT_TWO_ARG_CONTAINER(std::deque)
OUTPUT_TWO_ARG_CONTAINER(std::list) OUTPUT_TWO_ARG_CONTAINER(std::list)
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist)
#endif
#undef OUTPUT_TWO_ARG_CONTAINER #undef OUTPUT_TWO_ARG_CONTAINER
#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ #define OUTPUT_THREE_ARG_CONTAINER(Sequence) \
@ -130,19 +97,8 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_FOUR_ARG_CONTAINER(std::map) OUTPUT_FOUR_ARG_CONTAINER(std::map)
OUTPUT_FOUR_ARG_CONTAINER(std::multimap) OUTPUT_FOUR_ARG_CONTAINER(std::multimap)
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set)
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset)
#endif
#undef OUTPUT_FOUR_ARG_CONTAINER #undef OUTPUT_FOUR_ARG_CONTAINER
#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ #define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \
@ -153,18 +109,8 @@ inline std::ostream& operator<<(std::ostream& out, \
return out; \ return out; \
} }
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map)
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap)
#endif
#undef OUTPUT_FIVE_ARG_CONTAINER #undef OUTPUT_FIVE_ARG_CONTAINER
@ -189,7 +135,7 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
} }
} }
} } // namespace google
// Note that this is technically undefined behavior! We are adding things into // Note that this is technically undefined behavior! We are adding things into
// the std namespace for a reason though -- we are providing new operations on // the std namespace for a reason though -- we are providing new operations on
@ -215,6 +161,8 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
// move all of the *definitions* into namespace std, bet we need to ensure no // move all of the *definitions* into namespace std, bet we need to ensure no
// one references them first. This lets us take that step. We cannot define them // one references them first. This lets us take that step. We cannot define them
// in both because that would create ambiguous overloads when both are found. // in both because that would create ambiguous overloads when both are found.
namespace std { using ::operator<<; } namespace std {
using ::operator<<;
}
#endif // UTIL_GTL_STL_LOGGING_INL_H_ #endif // GLOG_STL_LOGGING_H

View file

@ -0,0 +1,81 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_TYPES_H
#define GLOG_TYPES_H
#include <cstddef>
#include <cstdint>
namespace google {
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using int64 = std::int64_t;
using uint64 = std::uint64_t;
} // namespace google
#if defined(__has_feature)
# if __has_feature(thread_sanitizer)
# define GLOG_SANITIZE_THREAD 1
# endif
#endif
#if !defined(GLOG_SANITIZE_THREAD) && defined(__SANITIZE_THREAD__) && \
__SANITIZE_THREAD__
# define GLOG_SANITIZE_THREAD 1
#endif
#if defined(GLOG_SANITIZE_THREAD)
# define GLOG_IFDEF_THREAD_SANITIZER(X) X
#else
# define GLOG_IFDEF_THREAD_SANITIZER(X)
#endif
#if defined(_MSC_VER)
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n) \
__pragma(warning(push)) __pragma(warning(disable : n))
# define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
#else
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
# define GLOG_MSVC_POP_WARNING()
#endif
#if defined(GLOG_SANITIZE_THREAD)
// We need to identify the static variables as "benign" races
// to avoid noisy reports from TSAN.
extern "C" void AnnotateBenignRaceSized(const char* file, int line,
const volatile void* mem, size_t size,
const char* description);
#endif // defined(GLOG_SANITIZE_THREAD)
#endif // GLOG_TYPES_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 1999, 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -58,10 +58,21 @@
// CAVEAT: --vmodule functionality is not available in non gcc compilers. // CAVEAT: --vmodule functionality is not available in non gcc compilers.
// //
#ifndef BASE_VLOG_IS_ON_H_ #ifndef GLOG_VLOG_IS_ON_H
#define BASE_VLOG_IS_ON_H_ #define GLOG_VLOG_IS_ON_H
#include <glog/log_severity.h> #include <cstddef>
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/vlog_is_on.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/flags.h"
#include "glog/types.h"
#if defined(__GNUC__) #if defined(__GNUC__)
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. // We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
@ -71,11 +82,15 @@
// matching the current source file that represents results of // matching the current source file that represents results of
// parsing of --vmodule flag and/or SetVLOGLevel calls. // parsing of --vmodule flag and/or SetVLOGLevel calls.
# define VLOG_IS_ON(verboselevel) \ # define VLOG_IS_ON(verboselevel) \
__extension__ \ __extension__({ \
({ static google::SiteFlag vlocal__ = {NULL, NULL, 0, NULL}; \ static google::SiteFlag vlocal__ = {nullptr, nullptr, 0, nullptr}; \
GLOG_IFDEF_THREAD_SANITIZER(AnnotateBenignRaceSized( \
__FILE__, __LINE__, &vlocal__, sizeof(google::SiteFlag), "")); \
google::int32 verbose_level__ = (verboselevel); \ google::int32 verbose_level__ = (verboselevel); \
(vlocal__.level == NULL ? google::InitVLOG3__(&vlocal__, &FLAGS_v, \ (vlocal__.level == nullptr \
__FILE__, verbose_level__) : *vlocal__.level >= verbose_level__); \ ? google::InitVLOG3__(&vlocal__, &FLAGS_v, __FILE__, \
verbose_level__) \
: *vlocal__.level >= verbose_level__); \
}) })
#else #else
// GNU extensions not available, so we do not support --vmodule. // GNU extensions not available, so we do not support --vmodule.
@ -83,6 +98,8 @@
# define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) # define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
#endif #endif
namespace google {
// Set VLOG(_IS_ON) level for module_pattern to log_level. // Set VLOG(_IS_ON) level for module_pattern to log_level.
// This lets us dynamically control what is normally set by the --vmodule flag. // This lets us dynamically control what is normally set by the --vmodule flag.
// Returns the level that previously applied to module_pattern. // Returns the level that previously applied to module_pattern.
@ -96,13 +113,13 @@ extern GLOG_EXPORT int SetVLOGLevel(const char* module_pattern, int log_level);
// Various declarations needed for VLOG_IS_ON above: ========================= // Various declarations needed for VLOG_IS_ON above: =========================
struct SiteFlag { struct SiteFlag {
google::int32* level; int32* level;
const char* base_name; const char* base_name;
size_t base_len; std::size_t base_len;
SiteFlag* next; SiteFlag* next;
}; };
// Helper routine which determines the logging info for a particalur VLOG site. // Helper routine which determines the logging info for a particular VLOG site.
// site_flag is the address of the site-local pointer to the controlling // site_flag is the address of the site-local pointer to the controlling
// verbosity level // verbosity level
// site_default is the default to use for *site_flag // site_default is the default to use for *site_flag
@ -110,9 +127,10 @@ struct SiteFlag {
// verbose_level is the argument to VLOG_IS_ON // verbose_level is the argument to VLOG_IS_ON
// We will return the return value for VLOG_IS_ON // We will return the return value for VLOG_IS_ON
// and if possible set *site_flag appropriately. // and if possible set *site_flag appropriately.
extern GLOG_EXPORT bool InitVLOG3__( extern GLOG_EXPORT bool InitVLOG3__(SiteFlag* site_flag,
google::SiteFlag* site_flag, int32* site_default,
google::int32* site_default, const char* fname, const char* fname,
google::int32 verbose_level); int32 verbose_level);
} // namespace google
#endif // BASE_VLOG_IS_ON_H_ #endif // GLOG_VLOG_IS_ON_H

View file

@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file(). # The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.6.0") set(PACKAGE_VERSION "0.7.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
else() else()
if("0.6.0" MATCHES "^([0-9]+)\\.") if("0.7.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif() endif()
else() else()
set(CVF_VERSION_MAJOR "0.6.0") set(CVF_VERSION_MAJOR "0.7.0")
endif() endif()
if(PACKAGE_FIND_VERSION_RANGE) if(PACKAGE_FIND_VERSION_RANGE)

View file

@ -21,6 +21,8 @@ endmacro()
include (CMakeFindDependencyMacro) include (CMakeFindDependencyMacro)
include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake)
find_dependency (Threads)

View file

@ -54,9 +54,10 @@ endif()
add_library(glog::glog STATIC IMPORTED) add_library(glog::glog STATIC IMPORTED)
set_target_properties(glog::glog PROPERTIES set_target_properties(glog::glog PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "GLOG_CUSTOM_PREFIX_SUPPORT" INTERFACE_COMPILE_DEFINITIONS "GLOG_USE_GLOG_EXPORT"
INTERFACE_COMPILE_FEATURES "cxx_std_14"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:-pthread>;\$<LINK_ONLY:log>" INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:log>"
) )
if(CMAKE_VERSION VERSION_LESS 2.8.12) if(CMAKE_VERSION VERSION_LESS 2.8.12)

Binary file not shown.

View file

@ -0,0 +1,191 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_FLAGS_H
#define GLOG_FLAGS_H
#include <string>
#if defined(GLOG_USE_GFLAGS)
# include <gflags/gflags.h>
#endif
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/flags.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/platform.h"
#include "glog/types.h"
#pragma push_macro("DECLARE_VARIABLE")
#pragma push_macro("DECLARE_bool")
#pragma push_macro("DECLARE_string")
#pragma push_macro("DECLARE_int32")
#pragma push_macro("DECLARE_uint32")
#ifdef DECLARE_VARIABLE
# undef DECLARE_VARIABLE
#endif
#ifdef DECLARE_bool
# undef DECLARE_bool
#endif
#ifdef DECLARE_string
# undef DECLARE_string
#endif
#ifdef DECLARE_int32
# undef DECLARE_int32
#endif
#ifdef DECLARE_uint32
# undef DECLARE_uint32
#endif
#ifndef DECLARE_VARIABLE
# define DECLARE_VARIABLE(type, shorttype, name, tn) \
namespace fL##shorttype { \
extern GLOG_EXPORT type FLAGS_##name; \
} \
using fL##shorttype::FLAGS_##name
// bool specialization
# define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name, bool)
// int32 specialization
# define DECLARE_int32(name) DECLARE_VARIABLE(google::int32, I, name, int32)
# if !defined(DECLARE_uint32)
// uint32 specialization
# define DECLARE_uint32(name) \
DECLARE_VARIABLE(google::uint32, U, name, uint32)
# endif // !defined(DECLARE_uint32) && !defined(GLOG_USE_GFLAGS)
// Special case for string, because we have to specify the namespace
// std::string, which doesn't play nicely with our FLAG__namespace hackery.
# define DECLARE_string(name) \
namespace fLS { \
extern GLOG_EXPORT std::string& FLAGS_##name; \
} \
using fLS::FLAGS_##name
#endif
DECLARE_int32(logemaillevel);
DECLARE_int32(logcleansecs);
#ifdef GLOG_OS_LINUX
DECLARE_bool(drop_log_memory);
#endif
DECLARE_string(alsologtoemail);
DECLARE_string(log_backtrace_at);
// Set whether appending a timestamp to the log file name
DECLARE_bool(timestamp_in_logfile_name);
// Set whether log messages go to stdout instead of logfiles
DECLARE_bool(logtostdout);
// Set color messages logged to stdout (if supported by terminal).
DECLARE_bool(colorlogtostdout);
// Set whether log messages go to stderr instead of logfiles
DECLARE_bool(logtostderr);
// Set whether log messages go to stderr in addition to logfiles.
DECLARE_bool(alsologtostderr);
// Set color messages logged to stderr (if supported by terminal).
DECLARE_bool(colorlogtostderr);
// Log messages at a level >= this flag are automatically sent to
// stderr in addition to log files.
DECLARE_int32(stderrthreshold);
// Set whether the log file header should be written upon creating a file.
DECLARE_bool(log_file_header);
// Set whether the log prefix should be prepended to each line of output.
DECLARE_bool(log_prefix);
// Set whether the year should be included in the log prefix.
DECLARE_bool(log_year_in_prefix);
// Log messages at a level <= this flag are buffered.
// Log messages at a higher level are flushed immediately.
DECLARE_int32(logbuflevel);
// Sets the maximum number of seconds which logs may be buffered for.
DECLARE_int32(logbufsecs);
// Log suppression level: messages logged at a lower level than this
// are suppressed.
DECLARE_int32(minloglevel);
// If specified, logfiles are written into this directory instead of the
// default logging directory.
DECLARE_string(log_dir);
// Set the log file mode.
DECLARE_int32(logfile_mode);
// Sets the path of the directory into which to put additional links
// to the log files.
DECLARE_string(log_link);
DECLARE_int32(v); // in vlog_is_on.cc
DECLARE_string(vmodule); // also in vlog_is_on.cc
// Sets the maximum log file size (in MB).
DECLARE_uint32(max_log_size);
// Sets whether to avoid logging to the disk if the disk is full.
DECLARE_bool(stop_logging_if_full_disk);
// Use UTC time for logging
DECLARE_bool(log_utc_time);
// Mailer used to send logging email
DECLARE_string(logmailer);
DECLARE_bool(symbolize_stacktrace);
#pragma pop_macro("DECLARE_VARIABLE")
#pragma pop_macro("DECLARE_bool")
#pragma pop_macro("DECLARE_string")
#pragma pop_macro("DECLARE_int32")
#pragma pop_macro("DECLARE_uint32")
#endif // GLOG_FLAGS_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -30,6 +30,16 @@
#ifndef BASE_LOG_SEVERITY_H__ #ifndef BASE_LOG_SEVERITY_H__
#define BASE_LOG_SEVERITY_H__ #define BASE_LOG_SEVERITY_H__
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
#endif
namespace google {
// The recommended semantics of the log levels are as follows: // The recommended semantics of the log levels are as follows:
// //
// INFO: // INFO:
@ -48,17 +58,35 @@
// Variables of type LogSeverity are widely taken to lie in the range // Variables of type LogSeverity are widely taken to lie in the range
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
// you ever need to change their values or add a new severity. // you ever need to change their values or add a new severity.
typedef int LogSeverity;
const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, enum LogSeverity {
NUM_SEVERITIES = 4; GLOG_INFO = 0,
GLOG_WARNING = 1,
GLOG_ERROR = 2,
GLOG_FATAL = 3,
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES #ifndef GLOG_NO_ABBREVIATED_SEVERITIES
# ifdef ERROR # ifdef ERROR
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
# endif # endif
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, INFO = GLOG_INFO,
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; WARNING = GLOG_WARNING,
ERROR = GLOG_ERROR,
FATAL = GLOG_FATAL
#endif #endif
};
#if defined(__cpp_inline_variables)
# if (__cpp_inline_variables >= 201606L)
# define GLOG_INLINE_VARIABLE inline
# endif // (__cpp_inline_variables >= 201606L)
#endif // defined(__cpp_inline_variables)
#if !defined(GLOG_INLINE_VARIABLE)
# define GLOG_INLINE_VARIABLE
#endif // !defined(GLOG_INLINE_VARIABLE)
GLOG_INLINE_VARIABLE
constexpr int NUM_SEVERITIES = 4;
// DFATAL is FATAL in debug mode, ERROR in normal mode // DFATAL is FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG #ifdef NDEBUG
@ -67,8 +95,6 @@ const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
# define DFATAL_LEVEL FATAL # define DFATAL_LEVEL FATAL
#endif #endif
extern GLOG_EXPORT const char* const LogSeverityNames[NUM_SEVERITIES];
// NDEBUG usage helpers related to (RAW_)DCHECK: // NDEBUG usage helpers related to (RAW_)DCHECK:
// //
// DEBUG_MODE is for small !NDEBUG uses like // DEBUG_MODE is for small !NDEBUG uses like
@ -95,4 +121,6 @@ enum { DEBUG_MODE = 1 };
# define IF_DEBUG_MODE(x) x # define IF_DEBUG_MODE(x) x
#endif #endif
} // namespace google
#endif // BASE_LOG_SEVERITY_H__ #endif // BASE_LOG_SEVERITY_H__

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright (c) 2008, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -42,6 +42,9 @@
# ifndef GLOG_OS_LINUX # ifndef GLOG_OS_LINUX
# define GLOG_OS_LINUX # define GLOG_OS_LINUX
# endif # endif
# if defined(__ANDROID__)
# define GLOG_OS_ANDROID
# endif
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
# define GLOG_OS_MACOSX # define GLOG_OS_MACOSX
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
@ -50,7 +53,8 @@
# define GLOG_OS_NETBSD # define GLOG_OS_NETBSD
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
# define GLOG_OS_OPENBSD # define GLOG_OS_OPENBSD
#else #elif defined(__EMSCRIPTEN__)
# define GLOG_OS_EMSCRIPTEN
// TODO(hamaji): Add other platforms. // TODO(hamaji): Add other platforms.
#error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github. #error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github.
#endif #endif

View file

@ -1,4 +1,4 @@
// Copyright (c) 2006, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -36,19 +36,19 @@
#ifndef GLOG_RAW_LOGGING_H #ifndef GLOG_RAW_LOGGING_H
#define GLOG_RAW_LOGGING_H #define GLOG_RAW_LOGGING_H
#include <ctime> #if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/raw_logging.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
namespace google { namespace google {
#include <glog/log_severity.h>
#include <glog/logging.h>
#include <glog/vlog_is_on.h>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
// This is similar to LOG(severity) << format... and VLOG(level) << format.., // This is similar to LOG(severity) << format... and VLOG(level) << format..,
// but // but
// * it is to be used ONLY by low-level modules that can't use normal LOG() // * it is to be used ONLY by low-level modules that can't use normal LOG()
@ -97,29 +97,29 @@ namespace google {
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG == 0 #if !defined(STRIP_LOG) || STRIP_LOG == 0
#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ # define RAW_LOG_INFO(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG <= 1 #if !defined(STRIP_LOG) || STRIP_LOG <= 1
#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ # define RAW_LOG_WARNING(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 1 #endif // STRIP_LOG <= 1
#if !defined(STRIP_LOG) || STRIP_LOG <= 2 #if !defined(STRIP_LOG) || STRIP_LOG <= 2
#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ # define RAW_LOG_ERROR(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 2 #endif // STRIP_LOG <= 2
#if !defined(STRIP_LOG) || STRIP_LOG <= 3 #if !defined(STRIP_LOG) || STRIP_LOG <= 3
#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ # define RAW_LOG_FATAL(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_FATAL(...) \ # define RAW_LOG_FATAL(...) \
do { \ do { \
@ -149,22 +149,15 @@ namespace google {
#else // NDEBUG #else // NDEBUG
# define RAW_DLOG(severity, ...) \ # define RAW_DLOG(severity, ...) \
while (false) \ while (false) RAW_LOG(severity, __VA_ARGS__)
RAW_LOG(severity, __VA_ARGS__)
# define RAW_DCHECK(condition, message) \ # define RAW_DCHECK(condition, message) \
while (false) \ while (false) RAW_CHECK(condition, message)
RAW_CHECK(condition, message)
#endif // NDEBUG #endif // NDEBUG
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Stub log function used to work around for unused variable warnings when // Stub log function used to work around for unused variable warnings when
// building with STRIP_LOG > 0. // building with STRIP_LOG > 0.
static inline void RawLogStub__(int /* ignored */, ...) { static inline void RawLogStub__(int /* ignored */, ...) {}
}
// Helper function to implement RAW_LOG and RAW_VLOG // Helper function to implement RAW_LOG and RAW_VLOG
// Logs format... at "severity" level, reporting it // Logs format... at "severity" level, reporting it
@ -172,8 +165,12 @@ static inline void RawLogStub__(int /* ignored */, ...) {
// This does not allocate memory or acquire locks. // This does not allocate memory or acquire locks.
GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line, GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line,
const char* format, ...) const char* format, ...)
__attribute__((__format__(__printf__, 4, 5))); #if defined(__has_attribute)
# if __has_attribute(used)
} __attribute__((__format__(__printf__, 4, 5)))
# endif
#endif
;
} // namespace google
#endif // GLOG_RAW_LOGGING_H #endif // GLOG_RAW_LOGGING_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2003, Google Inc. // Copyright (c) 2023, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -35,47 +35,19 @@
// vector<int> v1, v2; // vector<int> v1, v2;
// CHECK_EQ(v1, v2); // CHECK_EQ(v1, v2);
// //
// If you want to use this header file with hash maps or slist, you
// need to define macros before including this file:
//
// - GLOG_STL_LOGGING_FOR_UNORDERED - <unordered_map> and <unordered_set>
// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - <tr1/unordered_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_HASH - <ext/hash_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_SLIST - <ext/slist>
//
#ifndef UTIL_GTL_STL_LOGGING_INL_H_ #ifndef GLOG_STL_LOGGING_H
#define UTIL_GTL_STL_LOGGING_INL_H_ #define GLOG_STL_LOGGING_H
#if !1
# error We do not support stl_logging for this compiler
#endif
#include <deque> #include <deque>
#include <list> #include <list>
#include <map> #include <map>
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <utility>
#include <vector>
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#endif #include <utility>
#include <vector>
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
# include <tr1/unordered_map>
# include <tr1/unordered_set>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
# include <ext/hash_set>
# include <ext/hash_map>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
# include <ext/slist>
#endif
// Forward declare these two, and define them after all the container streams // Forward declare these two, and define them after all the container streams
// operators so that we can recurse from pair -> container -> container -> pair // operators so that we can recurse from pair -> container -> container -> pair
@ -89,7 +61,6 @@ template<class Iter>
void PrintSequence(std::ostream& out, Iter begin, Iter end); void PrintSequence(std::ostream& out, Iter begin, Iter end);
} }
#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ #define OUTPUT_TWO_ARG_CONTAINER(Sequence) \
template <class T1, class T2> \ template <class T1, class T2> \
inline std::ostream& operator<<(std::ostream& out, \ inline std::ostream& operator<<(std::ostream& out, \
@ -101,10 +72,6 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_TWO_ARG_CONTAINER(std::vector) OUTPUT_TWO_ARG_CONTAINER(std::vector)
OUTPUT_TWO_ARG_CONTAINER(std::deque) OUTPUT_TWO_ARG_CONTAINER(std::deque)
OUTPUT_TWO_ARG_CONTAINER(std::list) OUTPUT_TWO_ARG_CONTAINER(std::list)
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist)
#endif
#undef OUTPUT_TWO_ARG_CONTAINER #undef OUTPUT_TWO_ARG_CONTAINER
#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ #define OUTPUT_THREE_ARG_CONTAINER(Sequence) \
@ -130,19 +97,8 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_FOUR_ARG_CONTAINER(std::map) OUTPUT_FOUR_ARG_CONTAINER(std::map)
OUTPUT_FOUR_ARG_CONTAINER(std::multimap) OUTPUT_FOUR_ARG_CONTAINER(std::multimap)
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set)
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset)
#endif
#undef OUTPUT_FOUR_ARG_CONTAINER #undef OUTPUT_FOUR_ARG_CONTAINER
#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ #define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \
@ -153,18 +109,8 @@ inline std::ostream& operator<<(std::ostream& out, \
return out; \ return out; \
} }
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map)
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap)
#endif
#undef OUTPUT_FIVE_ARG_CONTAINER #undef OUTPUT_FIVE_ARG_CONTAINER
@ -189,7 +135,7 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
} }
} }
} } // namespace google
// Note that this is technically undefined behavior! We are adding things into // Note that this is technically undefined behavior! We are adding things into
// the std namespace for a reason though -- we are providing new operations on // the std namespace for a reason though -- we are providing new operations on
@ -215,6 +161,8 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
// move all of the *definitions* into namespace std, bet we need to ensure no // move all of the *definitions* into namespace std, bet we need to ensure no
// one references them first. This lets us take that step. We cannot define them // one references them first. This lets us take that step. We cannot define them
// in both because that would create ambiguous overloads when both are found. // in both because that would create ambiguous overloads when both are found.
namespace std { using ::operator<<; } namespace std {
using ::operator<<;
}
#endif // UTIL_GTL_STL_LOGGING_INL_H_ #endif // GLOG_STL_LOGGING_H

View file

@ -0,0 +1,81 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_TYPES_H
#define GLOG_TYPES_H
#include <cstddef>
#include <cstdint>
namespace google {
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using int64 = std::int64_t;
using uint64 = std::uint64_t;
} // namespace google
#if defined(__has_feature)
# if __has_feature(thread_sanitizer)
# define GLOG_SANITIZE_THREAD 1
# endif
#endif
#if !defined(GLOG_SANITIZE_THREAD) && defined(__SANITIZE_THREAD__) && \
__SANITIZE_THREAD__
# define GLOG_SANITIZE_THREAD 1
#endif
#if defined(GLOG_SANITIZE_THREAD)
# define GLOG_IFDEF_THREAD_SANITIZER(X) X
#else
# define GLOG_IFDEF_THREAD_SANITIZER(X)
#endif
#if defined(_MSC_VER)
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n) \
__pragma(warning(push)) __pragma(warning(disable : n))
# define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
#else
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
# define GLOG_MSVC_POP_WARNING()
#endif
#if defined(GLOG_SANITIZE_THREAD)
// We need to identify the static variables as "benign" races
// to avoid noisy reports from TSAN.
extern "C" void AnnotateBenignRaceSized(const char* file, int line,
const volatile void* mem, size_t size,
const char* description);
#endif // defined(GLOG_SANITIZE_THREAD)
#endif // GLOG_TYPES_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 1999, 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -58,10 +58,21 @@
// CAVEAT: --vmodule functionality is not available in non gcc compilers. // CAVEAT: --vmodule functionality is not available in non gcc compilers.
// //
#ifndef BASE_VLOG_IS_ON_H_ #ifndef GLOG_VLOG_IS_ON_H
#define BASE_VLOG_IS_ON_H_ #define GLOG_VLOG_IS_ON_H
#include <glog/log_severity.h> #include <cstddef>
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/vlog_is_on.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/flags.h"
#include "glog/types.h"
#if defined(__GNUC__) #if defined(__GNUC__)
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. // We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
@ -71,11 +82,15 @@
// matching the current source file that represents results of // matching the current source file that represents results of
// parsing of --vmodule flag and/or SetVLOGLevel calls. // parsing of --vmodule flag and/or SetVLOGLevel calls.
# define VLOG_IS_ON(verboselevel) \ # define VLOG_IS_ON(verboselevel) \
__extension__ \ __extension__({ \
({ static google::SiteFlag vlocal__ = {NULL, NULL, 0, NULL}; \ static google::SiteFlag vlocal__ = {nullptr, nullptr, 0, nullptr}; \
GLOG_IFDEF_THREAD_SANITIZER(AnnotateBenignRaceSized( \
__FILE__, __LINE__, &vlocal__, sizeof(google::SiteFlag), "")); \
google::int32 verbose_level__ = (verboselevel); \ google::int32 verbose_level__ = (verboselevel); \
(vlocal__.level == NULL ? google::InitVLOG3__(&vlocal__, &FLAGS_v, \ (vlocal__.level == nullptr \
__FILE__, verbose_level__) : *vlocal__.level >= verbose_level__); \ ? google::InitVLOG3__(&vlocal__, &FLAGS_v, __FILE__, \
verbose_level__) \
: *vlocal__.level >= verbose_level__); \
}) })
#else #else
// GNU extensions not available, so we do not support --vmodule. // GNU extensions not available, so we do not support --vmodule.
@ -83,6 +98,8 @@
# define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) # define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
#endif #endif
namespace google {
// Set VLOG(_IS_ON) level for module_pattern to log_level. // Set VLOG(_IS_ON) level for module_pattern to log_level.
// This lets us dynamically control what is normally set by the --vmodule flag. // This lets us dynamically control what is normally set by the --vmodule flag.
// Returns the level that previously applied to module_pattern. // Returns the level that previously applied to module_pattern.
@ -96,13 +113,13 @@ extern GLOG_EXPORT int SetVLOGLevel(const char* module_pattern, int log_level);
// Various declarations needed for VLOG_IS_ON above: ========================= // Various declarations needed for VLOG_IS_ON above: =========================
struct SiteFlag { struct SiteFlag {
google::int32* level; int32* level;
const char* base_name; const char* base_name;
size_t base_len; std::size_t base_len;
SiteFlag* next; SiteFlag* next;
}; };
// Helper routine which determines the logging info for a particalur VLOG site. // Helper routine which determines the logging info for a particular VLOG site.
// site_flag is the address of the site-local pointer to the controlling // site_flag is the address of the site-local pointer to the controlling
// verbosity level // verbosity level
// site_default is the default to use for *site_flag // site_default is the default to use for *site_flag
@ -110,9 +127,10 @@ struct SiteFlag {
// verbose_level is the argument to VLOG_IS_ON // verbose_level is the argument to VLOG_IS_ON
// We will return the return value for VLOG_IS_ON // We will return the return value for VLOG_IS_ON
// and if possible set *site_flag appropriately. // and if possible set *site_flag appropriately.
extern GLOG_EXPORT bool InitVLOG3__( extern GLOG_EXPORT bool InitVLOG3__(SiteFlag* site_flag,
google::SiteFlag* site_flag, int32* site_default,
google::int32* site_default, const char* fname, const char* fname,
google::int32 verbose_level); int32 verbose_level);
} // namespace google
#endif // BASE_VLOG_IS_ON_H_ #endif // GLOG_VLOG_IS_ON_H

View file

@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file(). # The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.6.0") set(PACKAGE_VERSION "0.7.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
else() else()
if("0.6.0" MATCHES "^([0-9]+)\\.") if("0.7.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif() endif()
else() else()
set(CVF_VERSION_MAJOR "0.6.0") set(CVF_VERSION_MAJOR "0.7.0")
endif() endif()
if(PACKAGE_FIND_VERSION_RANGE) if(PACKAGE_FIND_VERSION_RANGE)

View file

@ -21,6 +21,8 @@ endmacro()
include (CMakeFindDependencyMacro) include (CMakeFindDependencyMacro)
include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake)
find_dependency (Threads)

View file

@ -54,9 +54,10 @@ endif()
add_library(glog::glog STATIC IMPORTED) add_library(glog::glog STATIC IMPORTED)
set_target_properties(glog::glog PROPERTIES set_target_properties(glog::glog PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "GLOG_CUSTOM_PREFIX_SUPPORT" INTERFACE_COMPILE_DEFINITIONS "GLOG_USE_GLOG_EXPORT"
INTERFACE_COMPILE_FEATURES "cxx_std_14"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:-pthread>;\$<LINK_ONLY:log>" INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:log>"
) )
if(CMAKE_VERSION VERSION_LESS 2.8.12) if(CMAKE_VERSION VERSION_LESS 2.8.12)

Binary file not shown.

View file

@ -0,0 +1,191 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_FLAGS_H
#define GLOG_FLAGS_H
#include <string>
#if defined(GLOG_USE_GFLAGS)
# include <gflags/gflags.h>
#endif
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/flags.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/platform.h"
#include "glog/types.h"
#pragma push_macro("DECLARE_VARIABLE")
#pragma push_macro("DECLARE_bool")
#pragma push_macro("DECLARE_string")
#pragma push_macro("DECLARE_int32")
#pragma push_macro("DECLARE_uint32")
#ifdef DECLARE_VARIABLE
# undef DECLARE_VARIABLE
#endif
#ifdef DECLARE_bool
# undef DECLARE_bool
#endif
#ifdef DECLARE_string
# undef DECLARE_string
#endif
#ifdef DECLARE_int32
# undef DECLARE_int32
#endif
#ifdef DECLARE_uint32
# undef DECLARE_uint32
#endif
#ifndef DECLARE_VARIABLE
# define DECLARE_VARIABLE(type, shorttype, name, tn) \
namespace fL##shorttype { \
extern GLOG_EXPORT type FLAGS_##name; \
} \
using fL##shorttype::FLAGS_##name
// bool specialization
# define DECLARE_bool(name) DECLARE_VARIABLE(bool, B, name, bool)
// int32 specialization
# define DECLARE_int32(name) DECLARE_VARIABLE(google::int32, I, name, int32)
# if !defined(DECLARE_uint32)
// uint32 specialization
# define DECLARE_uint32(name) \
DECLARE_VARIABLE(google::uint32, U, name, uint32)
# endif // !defined(DECLARE_uint32) && !defined(GLOG_USE_GFLAGS)
// Special case for string, because we have to specify the namespace
// std::string, which doesn't play nicely with our FLAG__namespace hackery.
# define DECLARE_string(name) \
namespace fLS { \
extern GLOG_EXPORT std::string& FLAGS_##name; \
} \
using fLS::FLAGS_##name
#endif
DECLARE_int32(logemaillevel);
DECLARE_int32(logcleansecs);
#ifdef GLOG_OS_LINUX
DECLARE_bool(drop_log_memory);
#endif
DECLARE_string(alsologtoemail);
DECLARE_string(log_backtrace_at);
// Set whether appending a timestamp to the log file name
DECLARE_bool(timestamp_in_logfile_name);
// Set whether log messages go to stdout instead of logfiles
DECLARE_bool(logtostdout);
// Set color messages logged to stdout (if supported by terminal).
DECLARE_bool(colorlogtostdout);
// Set whether log messages go to stderr instead of logfiles
DECLARE_bool(logtostderr);
// Set whether log messages go to stderr in addition to logfiles.
DECLARE_bool(alsologtostderr);
// Set color messages logged to stderr (if supported by terminal).
DECLARE_bool(colorlogtostderr);
// Log messages at a level >= this flag are automatically sent to
// stderr in addition to log files.
DECLARE_int32(stderrthreshold);
// Set whether the log file header should be written upon creating a file.
DECLARE_bool(log_file_header);
// Set whether the log prefix should be prepended to each line of output.
DECLARE_bool(log_prefix);
// Set whether the year should be included in the log prefix.
DECLARE_bool(log_year_in_prefix);
// Log messages at a level <= this flag are buffered.
// Log messages at a higher level are flushed immediately.
DECLARE_int32(logbuflevel);
// Sets the maximum number of seconds which logs may be buffered for.
DECLARE_int32(logbufsecs);
// Log suppression level: messages logged at a lower level than this
// are suppressed.
DECLARE_int32(minloglevel);
// If specified, logfiles are written into this directory instead of the
// default logging directory.
DECLARE_string(log_dir);
// Set the log file mode.
DECLARE_int32(logfile_mode);
// Sets the path of the directory into which to put additional links
// to the log files.
DECLARE_string(log_link);
DECLARE_int32(v); // in vlog_is_on.cc
DECLARE_string(vmodule); // also in vlog_is_on.cc
// Sets the maximum log file size (in MB).
DECLARE_uint32(max_log_size);
// Sets whether to avoid logging to the disk if the disk is full.
DECLARE_bool(stop_logging_if_full_disk);
// Use UTC time for logging
DECLARE_bool(log_utc_time);
// Mailer used to send logging email
DECLARE_string(logmailer);
DECLARE_bool(symbolize_stacktrace);
#pragma pop_macro("DECLARE_VARIABLE")
#pragma pop_macro("DECLARE_bool")
#pragma pop_macro("DECLARE_string")
#pragma pop_macro("DECLARE_int32")
#pragma pop_macro("DECLARE_uint32")
#endif // GLOG_FLAGS_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -30,6 +30,16 @@
#ifndef BASE_LOG_SEVERITY_H__ #ifndef BASE_LOG_SEVERITY_H__
#define BASE_LOG_SEVERITY_H__ #define BASE_LOG_SEVERITY_H__
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/log_severity.h> was not included correctly. See the documention for how to consume the library.
#endif
namespace google {
// The recommended semantics of the log levels are as follows: // The recommended semantics of the log levels are as follows:
// //
// INFO: // INFO:
@ -48,17 +58,35 @@
// Variables of type LogSeverity are widely taken to lie in the range // Variables of type LogSeverity are widely taken to lie in the range
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
// you ever need to change their values or add a new severity. // you ever need to change their values or add a new severity.
typedef int LogSeverity;
const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, enum LogSeverity {
NUM_SEVERITIES = 4; GLOG_INFO = 0,
GLOG_WARNING = 1,
GLOG_ERROR = 2,
GLOG_FATAL = 3,
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES #ifndef GLOG_NO_ABBREVIATED_SEVERITIES
# ifdef ERROR # ifdef ERROR
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
# endif # endif
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, INFO = GLOG_INFO,
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; WARNING = GLOG_WARNING,
ERROR = GLOG_ERROR,
FATAL = GLOG_FATAL
#endif #endif
};
#if defined(__cpp_inline_variables)
# if (__cpp_inline_variables >= 201606L)
# define GLOG_INLINE_VARIABLE inline
# endif // (__cpp_inline_variables >= 201606L)
#endif // defined(__cpp_inline_variables)
#if !defined(GLOG_INLINE_VARIABLE)
# define GLOG_INLINE_VARIABLE
#endif // !defined(GLOG_INLINE_VARIABLE)
GLOG_INLINE_VARIABLE
constexpr int NUM_SEVERITIES = 4;
// DFATAL is FATAL in debug mode, ERROR in normal mode // DFATAL is FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG #ifdef NDEBUG
@ -67,8 +95,6 @@ const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
# define DFATAL_LEVEL FATAL # define DFATAL_LEVEL FATAL
#endif #endif
extern GLOG_EXPORT const char* const LogSeverityNames[NUM_SEVERITIES];
// NDEBUG usage helpers related to (RAW_)DCHECK: // NDEBUG usage helpers related to (RAW_)DCHECK:
// //
// DEBUG_MODE is for small !NDEBUG uses like // DEBUG_MODE is for small !NDEBUG uses like
@ -95,4 +121,6 @@ enum { DEBUG_MODE = 1 };
# define IF_DEBUG_MODE(x) x # define IF_DEBUG_MODE(x) x
#endif #endif
} // namespace google
#endif // BASE_LOG_SEVERITY_H__ #endif // BASE_LOG_SEVERITY_H__

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright (c) 2008, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -42,6 +42,9 @@
# ifndef GLOG_OS_LINUX # ifndef GLOG_OS_LINUX
# define GLOG_OS_LINUX # define GLOG_OS_LINUX
# endif # endif
# if defined(__ANDROID__)
# define GLOG_OS_ANDROID
# endif
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
# define GLOG_OS_MACOSX # define GLOG_OS_MACOSX
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
@ -50,7 +53,8 @@
# define GLOG_OS_NETBSD # define GLOG_OS_NETBSD
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
# define GLOG_OS_OPENBSD # define GLOG_OS_OPENBSD
#else #elif defined(__EMSCRIPTEN__)
# define GLOG_OS_EMSCRIPTEN
// TODO(hamaji): Add other platforms. // TODO(hamaji): Add other platforms.
#error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github. #error Platform not supported by glog. Please consider to contribute platform information by submitting a pull request on Github.
#endif #endif

View file

@ -1,4 +1,4 @@
// Copyright (c) 2006, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -36,19 +36,19 @@
#ifndef GLOG_RAW_LOGGING_H #ifndef GLOG_RAW_LOGGING_H
#define GLOG_RAW_LOGGING_H #define GLOG_RAW_LOGGING_H
#include <ctime> #if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/raw_logging.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
namespace google { namespace google {
#include <glog/log_severity.h>
#include <glog/logging.h>
#include <glog/vlog_is_on.h>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
// This is similar to LOG(severity) << format... and VLOG(level) << format.., // This is similar to LOG(severity) << format... and VLOG(level) << format..,
// but // but
// * it is to be used ONLY by low-level modules that can't use normal LOG() // * it is to be used ONLY by low-level modules that can't use normal LOG()
@ -97,29 +97,29 @@ namespace google {
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG == 0 #if !defined(STRIP_LOG) || STRIP_LOG == 0
#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ # define RAW_LOG_INFO(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG == 0 #endif // STRIP_LOG == 0
#if !defined(STRIP_LOG) || STRIP_LOG <= 1 #if !defined(STRIP_LOG) || STRIP_LOG <= 1
#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ # define RAW_LOG_WARNING(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 1 #endif // STRIP_LOG <= 1
#if !defined(STRIP_LOG) || STRIP_LOG <= 2 #if !defined(STRIP_LOG) || STRIP_LOG <= 2
#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ # define RAW_LOG_ERROR(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) # define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
#endif // STRIP_LOG <= 2 #endif // STRIP_LOG <= 2
#if !defined(STRIP_LOG) || STRIP_LOG <= 3 #if !defined(STRIP_LOG) || STRIP_LOG <= 3
#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ # define RAW_LOG_FATAL(...) \
__FILE__, __LINE__, __VA_ARGS__) google::RawLog__(google::GLOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)
#else #else
# define RAW_LOG_FATAL(...) \ # define RAW_LOG_FATAL(...) \
do { \ do { \
@ -149,22 +149,15 @@ namespace google {
#else // NDEBUG #else // NDEBUG
# define RAW_DLOG(severity, ...) \ # define RAW_DLOG(severity, ...) \
while (false) \ while (false) RAW_LOG(severity, __VA_ARGS__)
RAW_LOG(severity, __VA_ARGS__)
# define RAW_DCHECK(condition, message) \ # define RAW_DCHECK(condition, message) \
while (false) \ while (false) RAW_CHECK(condition, message)
RAW_CHECK(condition, message)
#endif // NDEBUG #endif // NDEBUG
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Stub log function used to work around for unused variable warnings when // Stub log function used to work around for unused variable warnings when
// building with STRIP_LOG > 0. // building with STRIP_LOG > 0.
static inline void RawLogStub__(int /* ignored */, ...) { static inline void RawLogStub__(int /* ignored */, ...) {}
}
// Helper function to implement RAW_LOG and RAW_VLOG // Helper function to implement RAW_LOG and RAW_VLOG
// Logs format... at "severity" level, reporting it // Logs format... at "severity" level, reporting it
@ -172,8 +165,12 @@ static inline void RawLogStub__(int /* ignored */, ...) {
// This does not allocate memory or acquire locks. // This does not allocate memory or acquire locks.
GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line, GLOG_EXPORT void RawLog__(LogSeverity severity, const char* file, int line,
const char* format, ...) const char* format, ...)
__attribute__((__format__(__printf__, 4, 5))); #if defined(__has_attribute)
# if __has_attribute(used)
} __attribute__((__format__(__printf__, 4, 5)))
# endif
#endif
;
} // namespace google
#endif // GLOG_RAW_LOGGING_H #endif // GLOG_RAW_LOGGING_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 2003, Google Inc. // Copyright (c) 2023, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -35,47 +35,19 @@
// vector<int> v1, v2; // vector<int> v1, v2;
// CHECK_EQ(v1, v2); // CHECK_EQ(v1, v2);
// //
// If you want to use this header file with hash maps or slist, you
// need to define macros before including this file:
//
// - GLOG_STL_LOGGING_FOR_UNORDERED - <unordered_map> and <unordered_set>
// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - <tr1/unordered_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_HASH - <ext/hash_(map|set)>
// - GLOG_STL_LOGGING_FOR_EXT_SLIST - <ext/slist>
//
#ifndef UTIL_GTL_STL_LOGGING_INL_H_ #ifndef GLOG_STL_LOGGING_H
#define UTIL_GTL_STL_LOGGING_INL_H_ #define GLOG_STL_LOGGING_H
#if !1
# error We do not support stl_logging for this compiler
#endif
#include <deque> #include <deque>
#include <list> #include <list>
#include <map> #include <map>
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <utility>
#include <vector>
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#endif #include <utility>
#include <vector>
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
# include <tr1/unordered_map>
# include <tr1/unordered_set>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
# include <ext/hash_set>
# include <ext/hash_map>
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
# include <ext/slist>
#endif
// Forward declare these two, and define them after all the container streams // Forward declare these two, and define them after all the container streams
// operators so that we can recurse from pair -> container -> container -> pair // operators so that we can recurse from pair -> container -> container -> pair
@ -89,7 +61,6 @@ template<class Iter>
void PrintSequence(std::ostream& out, Iter begin, Iter end); void PrintSequence(std::ostream& out, Iter begin, Iter end);
} }
#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ #define OUTPUT_TWO_ARG_CONTAINER(Sequence) \
template <class T1, class T2> \ template <class T1, class T2> \
inline std::ostream& operator<<(std::ostream& out, \ inline std::ostream& operator<<(std::ostream& out, \
@ -101,10 +72,6 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_TWO_ARG_CONTAINER(std::vector) OUTPUT_TWO_ARG_CONTAINER(std::vector)
OUTPUT_TWO_ARG_CONTAINER(std::deque) OUTPUT_TWO_ARG_CONTAINER(std::deque)
OUTPUT_TWO_ARG_CONTAINER(std::list) OUTPUT_TWO_ARG_CONTAINER(std::list)
#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST
OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist)
#endif
#undef OUTPUT_TWO_ARG_CONTAINER #undef OUTPUT_TWO_ARG_CONTAINER
#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ #define OUTPUT_THREE_ARG_CONTAINER(Sequence) \
@ -130,19 +97,8 @@ inline std::ostream& operator<<(std::ostream& out, \
OUTPUT_FOUR_ARG_CONTAINER(std::map) OUTPUT_FOUR_ARG_CONTAINER(std::map)
OUTPUT_FOUR_ARG_CONTAINER(std::multimap) OUTPUT_FOUR_ARG_CONTAINER(std::multimap)
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set)
OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set)
OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset)
#endif
#undef OUTPUT_FOUR_ARG_CONTAINER #undef OUTPUT_FOUR_ARG_CONTAINER
#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ #define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \
@ -153,18 +109,8 @@ inline std::ostream& operator<<(std::ostream& out, \
return out; \ return out; \
} }
#if defined(GLOG_STL_LOGGING_FOR_UNORDERED) && __cplusplus >= 201103L
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map)
OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap)
#endif
#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map)
OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap)
#endif
#undef OUTPUT_FIVE_ARG_CONTAINER #undef OUTPUT_FIVE_ARG_CONTAINER
@ -189,7 +135,7 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
} }
} }
} } // namespace google
// Note that this is technically undefined behavior! We are adding things into // Note that this is technically undefined behavior! We are adding things into
// the std namespace for a reason though -- we are providing new operations on // the std namespace for a reason though -- we are providing new operations on
@ -215,6 +161,8 @@ inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
// move all of the *definitions* into namespace std, bet we need to ensure no // move all of the *definitions* into namespace std, bet we need to ensure no
// one references them first. This lets us take that step. We cannot define them // one references them first. This lets us take that step. We cannot define them
// in both because that would create ambiguous overloads when both are found. // in both because that would create ambiguous overloads when both are found.
namespace std { using ::operator<<; } namespace std {
using ::operator<<;
}
#endif // UTIL_GTL_STL_LOGGING_INL_H_ #endif // GLOG_STL_LOGGING_H

View file

@ -0,0 +1,81 @@
// Copyright (c) 2024, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef GLOG_TYPES_H
#define GLOG_TYPES_H
#include <cstddef>
#include <cstdint>
namespace google {
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using int64 = std::int64_t;
using uint64 = std::uint64_t;
} // namespace google
#if defined(__has_feature)
# if __has_feature(thread_sanitizer)
# define GLOG_SANITIZE_THREAD 1
# endif
#endif
#if !defined(GLOG_SANITIZE_THREAD) && defined(__SANITIZE_THREAD__) && \
__SANITIZE_THREAD__
# define GLOG_SANITIZE_THREAD 1
#endif
#if defined(GLOG_SANITIZE_THREAD)
# define GLOG_IFDEF_THREAD_SANITIZER(X) X
#else
# define GLOG_IFDEF_THREAD_SANITIZER(X)
#endif
#if defined(_MSC_VER)
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n) \
__pragma(warning(push)) __pragma(warning(disable : n))
# define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
#else
# define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
# define GLOG_MSVC_POP_WARNING()
#endif
#if defined(GLOG_SANITIZE_THREAD)
// We need to identify the static variables as "benign" races
// to avoid noisy reports from TSAN.
extern "C" void AnnotateBenignRaceSized(const char* file, int line,
const volatile void* mem, size_t size,
const char* description);
#endif // defined(GLOG_SANITIZE_THREAD)
#endif // GLOG_TYPES_H

View file

@ -1,4 +1,4 @@
// Copyright (c) 1999, 2007, Google Inc. // Copyright (c) 2024, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -58,10 +58,21 @@
// CAVEAT: --vmodule functionality is not available in non gcc compilers. // CAVEAT: --vmodule functionality is not available in non gcc compilers.
// //
#ifndef BASE_VLOG_IS_ON_H_ #ifndef GLOG_VLOG_IS_ON_H
#define BASE_VLOG_IS_ON_H_ #define GLOG_VLOG_IS_ON_H
#include <glog/log_severity.h> #include <cstddef>
#if defined(GLOG_USE_GLOG_EXPORT)
# include "glog/export.h"
#endif
#if !defined(GLOG_EXPORT)
# error <glog/vlog_is_on.h> was not included correctly. See the documention for how to consume the library.
#endif
#include "glog/flags.h"
#include "glog/types.h"
#if defined(__GNUC__) #if defined(__GNUC__)
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. // We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
@ -71,11 +82,15 @@
// matching the current source file that represents results of // matching the current source file that represents results of
// parsing of --vmodule flag and/or SetVLOGLevel calls. // parsing of --vmodule flag and/or SetVLOGLevel calls.
# define VLOG_IS_ON(verboselevel) \ # define VLOG_IS_ON(verboselevel) \
__extension__ \ __extension__({ \
({ static google::SiteFlag vlocal__ = {NULL, NULL, 0, NULL}; \ static google::SiteFlag vlocal__ = {nullptr, nullptr, 0, nullptr}; \
GLOG_IFDEF_THREAD_SANITIZER(AnnotateBenignRaceSized( \
__FILE__, __LINE__, &vlocal__, sizeof(google::SiteFlag), "")); \
google::int32 verbose_level__ = (verboselevel); \ google::int32 verbose_level__ = (verboselevel); \
(vlocal__.level == NULL ? google::InitVLOG3__(&vlocal__, &FLAGS_v, \ (vlocal__.level == nullptr \
__FILE__, verbose_level__) : *vlocal__.level >= verbose_level__); \ ? google::InitVLOG3__(&vlocal__, &FLAGS_v, __FILE__, \
verbose_level__) \
: *vlocal__.level >= verbose_level__); \
}) })
#else #else
// GNU extensions not available, so we do not support --vmodule. // GNU extensions not available, so we do not support --vmodule.
@ -83,6 +98,8 @@
# define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) # define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
#endif #endif
namespace google {
// Set VLOG(_IS_ON) level for module_pattern to log_level. // Set VLOG(_IS_ON) level for module_pattern to log_level.
// This lets us dynamically control what is normally set by the --vmodule flag. // This lets us dynamically control what is normally set by the --vmodule flag.
// Returns the level that previously applied to module_pattern. // Returns the level that previously applied to module_pattern.
@ -96,13 +113,13 @@ extern GLOG_EXPORT int SetVLOGLevel(const char* module_pattern, int log_level);
// Various declarations needed for VLOG_IS_ON above: ========================= // Various declarations needed for VLOG_IS_ON above: =========================
struct SiteFlag { struct SiteFlag {
google::int32* level; int32* level;
const char* base_name; const char* base_name;
size_t base_len; std::size_t base_len;
SiteFlag* next; SiteFlag* next;
}; };
// Helper routine which determines the logging info for a particalur VLOG site. // Helper routine which determines the logging info for a particular VLOG site.
// site_flag is the address of the site-local pointer to the controlling // site_flag is the address of the site-local pointer to the controlling
// verbosity level // verbosity level
// site_default is the default to use for *site_flag // site_default is the default to use for *site_flag
@ -110,9 +127,10 @@ struct SiteFlag {
// verbose_level is the argument to VLOG_IS_ON // verbose_level is the argument to VLOG_IS_ON
// We will return the return value for VLOG_IS_ON // We will return the return value for VLOG_IS_ON
// and if possible set *site_flag appropriately. // and if possible set *site_flag appropriately.
extern GLOG_EXPORT bool InitVLOG3__( extern GLOG_EXPORT bool InitVLOG3__(SiteFlag* site_flag,
google::SiteFlag* site_flag, int32* site_default,
google::int32* site_default, const char* fname, const char* fname,
google::int32 verbose_level); int32 verbose_level);
} // namespace google
#endif // BASE_VLOG_IS_ON_H_ #endif // GLOG_VLOG_IS_ON_H

View file

@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file(). # The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.6.0") set(PACKAGE_VERSION "0.7.0")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE) set(PACKAGE_VERSION_COMPATIBLE FALSE)
else() else()
if("0.6.0" MATCHES "^([0-9]+)\\.") if("0.7.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif() endif()
else() else()
set(CVF_VERSION_MAJOR "0.6.0") set(CVF_VERSION_MAJOR "0.7.0")
endif() endif()
if(PACKAGE_FIND_VERSION_RANGE) if(PACKAGE_FIND_VERSION_RANGE)

View file

@ -21,6 +21,8 @@ endmacro()
include (CMakeFindDependencyMacro) include (CMakeFindDependencyMacro)
include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake) include (${CMAKE_CURRENT_LIST_DIR}/glog-modules.cmake)
find_dependency (Threads)

View file

@ -54,9 +54,10 @@ endif()
add_library(glog::glog STATIC IMPORTED) add_library(glog::glog STATIC IMPORTED)
set_target_properties(glog::glog PROPERTIES set_target_properties(glog::glog PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "GLOG_CUSTOM_PREFIX_SUPPORT" INTERFACE_COMPILE_DEFINITIONS "GLOG_USE_GLOG_EXPORT"
INTERFACE_COMPILE_FEATURES "cxx_std_14"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:-pthread>;\$<LINK_ONLY:log>" INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:log>"
) )
if(CMAKE_VERSION VERSION_LESS 2.8.12) if(CMAKE_VERSION VERSION_LESS 2.8.12)

Binary file not shown.

View file

@ -413,9 +413,13 @@ RIME_API RimeModule* RimeFindModule(const char* module_name);
//! Run a registered task //! Run a registered task
RIME_API Bool RimeRunTask(const char* task_name); RIME_API Bool RimeRunTask(const char* task_name);
//! \deprecated use RimeApi::get_shared_data_dir_s instead.
RIME_API const char* RimeGetSharedDataDir(void); RIME_API const char* RimeGetSharedDataDir(void);
//! \deprecated use RimeApi::get_user_data_dir_s instead.
RIME_API const char* RimeGetUserDataDir(void); RIME_API const char* RimeGetUserDataDir(void);
//! \deprecated use RimeApi::get_sync_dir_s instead.
RIME_API const char* RimeGetSyncDir(void); RIME_API const char* RimeGetSyncDir(void);
RIME_API const char* RimeGetUserId(void); RIME_API const char* RimeGetUserId(void);
/*! The API structure /*! The API structure
@ -543,9 +547,14 @@ typedef struct rime_api_t {
RimeModule* (*find_module)(const char* module_name); RimeModule* (*find_module)(const char* module_name);
Bool (*run_task)(const char* task_name); Bool (*run_task)(const char* task_name);
//! \deprecated use get_shared_data_dir_s instead.
const char* (*get_shared_data_dir)(void); const char* (*get_shared_data_dir)(void);
//! \deprecated use get_user_data_dir_s instead.
const char* (*get_user_data_dir)(void); const char* (*get_user_data_dir)(void);
//! \deprecated use get_sync_dir_s instead.
const char* (*get_sync_dir)(void); const char* (*get_sync_dir)(void);
const char* (*get_user_id)(void); const char* (*get_user_id)(void);
void (*get_user_data_sync_dir)(char* dir, size_t buffer_size); void (*get_user_data_sync_dir)(char* dir, size_t buffer_size);
@ -618,11 +627,13 @@ typedef struct rime_api_t {
int index); int index);
//! prebuilt data directory. //! prebuilt data directory.
//! \deprecated use get_prebuilt_data_dir_s instead.
const char* (*get_prebuilt_data_dir)(void); const char* (*get_prebuilt_data_dir)(void);
//! staging directory, stores data files deployed to a Rime client. //! staging directory, stores data files deployed to a Rime client.
//! \deprecated use get_staging_dir_s instead.
const char* (*get_staging_dir)(void); const char* (*get_staging_dir)(void);
//! Deprecated: for capnproto API, use "proto" module from librime-proto //! \deprecated for capnproto API, use "proto" module from librime-proto
//! plugin. //! plugin.
void (*commit_proto)(RimeSessionId session_id, void (*commit_proto)(RimeSessionId session_id,
RIME_PROTO_BUILDER* commit_builder); RIME_PROTO_BUILDER* commit_builder);
@ -647,6 +658,20 @@ typedef struct rime_api_t {
Bool abbreviated); Bool abbreviated);
Bool (*set_input)(RimeSessionId session_id, const char* input); Bool (*set_input)(RimeSessionId session_id, const char* input);
void (*get_shared_data_dir_s)(char* dir, size_t buffer_size);
void (*get_user_data_dir_s)(char* dir, size_t buffer_size);
void (*get_prebuilt_data_dir_s)(char* dir, size_t buffer_size);
void (*get_staging_dir_s)(char* dir, size_t buffer_size);
void (*get_sync_dir_s)(char* dir, size_t buffer_size);
//! highlight a selection without committing
Bool (*highlight_candidate)(RimeSessionId session_id, size_t index);
//! highlight a selection without committing
Bool (*highlight_candidate_on_current_page)(RimeSessionId session_id,
size_t index);
Bool (*change_page)(RimeSessionId session_id, Bool backward);
} RimeApi; } RimeApi;
//! API entry //! API entry

Binary file not shown.

View file

@ -413,9 +413,13 @@ RIME_API RimeModule* RimeFindModule(const char* module_name);
//! Run a registered task //! Run a registered task
RIME_API Bool RimeRunTask(const char* task_name); RIME_API Bool RimeRunTask(const char* task_name);
//! \deprecated use RimeApi::get_shared_data_dir_s instead.
RIME_API const char* RimeGetSharedDataDir(void); RIME_API const char* RimeGetSharedDataDir(void);
//! \deprecated use RimeApi::get_user_data_dir_s instead.
RIME_API const char* RimeGetUserDataDir(void); RIME_API const char* RimeGetUserDataDir(void);
//! \deprecated use RimeApi::get_sync_dir_s instead.
RIME_API const char* RimeGetSyncDir(void); RIME_API const char* RimeGetSyncDir(void);
RIME_API const char* RimeGetUserId(void); RIME_API const char* RimeGetUserId(void);
/*! The API structure /*! The API structure
@ -543,9 +547,14 @@ typedef struct rime_api_t {
RimeModule* (*find_module)(const char* module_name); RimeModule* (*find_module)(const char* module_name);
Bool (*run_task)(const char* task_name); Bool (*run_task)(const char* task_name);
//! \deprecated use get_shared_data_dir_s instead.
const char* (*get_shared_data_dir)(void); const char* (*get_shared_data_dir)(void);
//! \deprecated use get_user_data_dir_s instead.
const char* (*get_user_data_dir)(void); const char* (*get_user_data_dir)(void);
//! \deprecated use get_sync_dir_s instead.
const char* (*get_sync_dir)(void); const char* (*get_sync_dir)(void);
const char* (*get_user_id)(void); const char* (*get_user_id)(void);
void (*get_user_data_sync_dir)(char* dir, size_t buffer_size); void (*get_user_data_sync_dir)(char* dir, size_t buffer_size);
@ -618,11 +627,13 @@ typedef struct rime_api_t {
int index); int index);
//! prebuilt data directory. //! prebuilt data directory.
//! \deprecated use get_prebuilt_data_dir_s instead.
const char* (*get_prebuilt_data_dir)(void); const char* (*get_prebuilt_data_dir)(void);
//! staging directory, stores data files deployed to a Rime client. //! staging directory, stores data files deployed to a Rime client.
//! \deprecated use get_staging_dir_s instead.
const char* (*get_staging_dir)(void); const char* (*get_staging_dir)(void);
//! Deprecated: for capnproto API, use "proto" module from librime-proto //! \deprecated for capnproto API, use "proto" module from librime-proto
//! plugin. //! plugin.
void (*commit_proto)(RimeSessionId session_id, void (*commit_proto)(RimeSessionId session_id,
RIME_PROTO_BUILDER* commit_builder); RIME_PROTO_BUILDER* commit_builder);
@ -647,6 +658,20 @@ typedef struct rime_api_t {
Bool abbreviated); Bool abbreviated);
Bool (*set_input)(RimeSessionId session_id, const char* input); Bool (*set_input)(RimeSessionId session_id, const char* input);
void (*get_shared_data_dir_s)(char* dir, size_t buffer_size);
void (*get_user_data_dir_s)(char* dir, size_t buffer_size);
void (*get_prebuilt_data_dir_s)(char* dir, size_t buffer_size);
void (*get_staging_dir_s)(char* dir, size_t buffer_size);
void (*get_sync_dir_s)(char* dir, size_t buffer_size);
//! highlight a selection without committing
Bool (*highlight_candidate)(RimeSessionId session_id, size_t index);
//! highlight a selection without committing
Bool (*highlight_candidate_on_current_page)(RimeSessionId session_id,
size_t index);
Bool (*change_page)(RimeSessionId session_id, Bool backward);
} RimeApi; } RimeApi;
//! API entry //! API entry

Binary file not shown.

View file

@ -413,9 +413,13 @@ RIME_API RimeModule* RimeFindModule(const char* module_name);
//! Run a registered task //! Run a registered task
RIME_API Bool RimeRunTask(const char* task_name); RIME_API Bool RimeRunTask(const char* task_name);
//! \deprecated use RimeApi::get_shared_data_dir_s instead.
RIME_API const char* RimeGetSharedDataDir(void); RIME_API const char* RimeGetSharedDataDir(void);
//! \deprecated use RimeApi::get_user_data_dir_s instead.
RIME_API const char* RimeGetUserDataDir(void); RIME_API const char* RimeGetUserDataDir(void);
//! \deprecated use RimeApi::get_sync_dir_s instead.
RIME_API const char* RimeGetSyncDir(void); RIME_API const char* RimeGetSyncDir(void);
RIME_API const char* RimeGetUserId(void); RIME_API const char* RimeGetUserId(void);
/*! The API structure /*! The API structure
@ -543,9 +547,14 @@ typedef struct rime_api_t {
RimeModule* (*find_module)(const char* module_name); RimeModule* (*find_module)(const char* module_name);
Bool (*run_task)(const char* task_name); Bool (*run_task)(const char* task_name);
//! \deprecated use get_shared_data_dir_s instead.
const char* (*get_shared_data_dir)(void); const char* (*get_shared_data_dir)(void);
//! \deprecated use get_user_data_dir_s instead.
const char* (*get_user_data_dir)(void); const char* (*get_user_data_dir)(void);
//! \deprecated use get_sync_dir_s instead.
const char* (*get_sync_dir)(void); const char* (*get_sync_dir)(void);
const char* (*get_user_id)(void); const char* (*get_user_id)(void);
void (*get_user_data_sync_dir)(char* dir, size_t buffer_size); void (*get_user_data_sync_dir)(char* dir, size_t buffer_size);
@ -618,11 +627,13 @@ typedef struct rime_api_t {
int index); int index);
//! prebuilt data directory. //! prebuilt data directory.
//! \deprecated use get_prebuilt_data_dir_s instead.
const char* (*get_prebuilt_data_dir)(void); const char* (*get_prebuilt_data_dir)(void);
//! staging directory, stores data files deployed to a Rime client. //! staging directory, stores data files deployed to a Rime client.
//! \deprecated use get_staging_dir_s instead.
const char* (*get_staging_dir)(void); const char* (*get_staging_dir)(void);
//! Deprecated: for capnproto API, use "proto" module from librime-proto //! \deprecated for capnproto API, use "proto" module from librime-proto
//! plugin. //! plugin.
void (*commit_proto)(RimeSessionId session_id, void (*commit_proto)(RimeSessionId session_id,
RIME_PROTO_BUILDER* commit_builder); RIME_PROTO_BUILDER* commit_builder);
@ -647,6 +658,20 @@ typedef struct rime_api_t {
Bool abbreviated); Bool abbreviated);
Bool (*set_input)(RimeSessionId session_id, const char* input); Bool (*set_input)(RimeSessionId session_id, const char* input);
void (*get_shared_data_dir_s)(char* dir, size_t buffer_size);
void (*get_user_data_dir_s)(char* dir, size_t buffer_size);
void (*get_prebuilt_data_dir_s)(char* dir, size_t buffer_size);
void (*get_staging_dir_s)(char* dir, size_t buffer_size);
void (*get_sync_dir_s)(char* dir, size_t buffer_size);
//! highlight a selection without committing
Bool (*highlight_candidate)(RimeSessionId session_id, size_t index);
//! highlight a selection without committing
Bool (*highlight_candidate_on_current_page)(RimeSessionId session_id,
size_t index);
Bool (*change_page)(RimeSessionId session_id, Bool backward);
} RimeApi; } RimeApi;
//! API entry //! API entry

Binary file not shown.

View file

@ -413,9 +413,13 @@ RIME_API RimeModule* RimeFindModule(const char* module_name);
//! Run a registered task //! Run a registered task
RIME_API Bool RimeRunTask(const char* task_name); RIME_API Bool RimeRunTask(const char* task_name);
//! \deprecated use RimeApi::get_shared_data_dir_s instead.
RIME_API const char* RimeGetSharedDataDir(void); RIME_API const char* RimeGetSharedDataDir(void);
//! \deprecated use RimeApi::get_user_data_dir_s instead.
RIME_API const char* RimeGetUserDataDir(void); RIME_API const char* RimeGetUserDataDir(void);
//! \deprecated use RimeApi::get_sync_dir_s instead.
RIME_API const char* RimeGetSyncDir(void); RIME_API const char* RimeGetSyncDir(void);
RIME_API const char* RimeGetUserId(void); RIME_API const char* RimeGetUserId(void);
/*! The API structure /*! The API structure
@ -543,9 +547,14 @@ typedef struct rime_api_t {
RimeModule* (*find_module)(const char* module_name); RimeModule* (*find_module)(const char* module_name);
Bool (*run_task)(const char* task_name); Bool (*run_task)(const char* task_name);
//! \deprecated use get_shared_data_dir_s instead.
const char* (*get_shared_data_dir)(void); const char* (*get_shared_data_dir)(void);
//! \deprecated use get_user_data_dir_s instead.
const char* (*get_user_data_dir)(void); const char* (*get_user_data_dir)(void);
//! \deprecated use get_sync_dir_s instead.
const char* (*get_sync_dir)(void); const char* (*get_sync_dir)(void);
const char* (*get_user_id)(void); const char* (*get_user_id)(void);
void (*get_user_data_sync_dir)(char* dir, size_t buffer_size); void (*get_user_data_sync_dir)(char* dir, size_t buffer_size);
@ -618,11 +627,13 @@ typedef struct rime_api_t {
int index); int index);
//! prebuilt data directory. //! prebuilt data directory.
//! \deprecated use get_prebuilt_data_dir_s instead.
const char* (*get_prebuilt_data_dir)(void); const char* (*get_prebuilt_data_dir)(void);
//! staging directory, stores data files deployed to a Rime client. //! staging directory, stores data files deployed to a Rime client.
//! \deprecated use get_staging_dir_s instead.
const char* (*get_staging_dir)(void); const char* (*get_staging_dir)(void);
//! Deprecated: for capnproto API, use "proto" module from librime-proto //! \deprecated for capnproto API, use "proto" module from librime-proto
//! plugin. //! plugin.
void (*commit_proto)(RimeSessionId session_id, void (*commit_proto)(RimeSessionId session_id,
RIME_PROTO_BUILDER* commit_builder); RIME_PROTO_BUILDER* commit_builder);
@ -647,6 +658,20 @@ typedef struct rime_api_t {
Bool abbreviated); Bool abbreviated);
Bool (*set_input)(RimeSessionId session_id, const char* input); Bool (*set_input)(RimeSessionId session_id, const char* input);
void (*get_shared_data_dir_s)(char* dir, size_t buffer_size);
void (*get_user_data_dir_s)(char* dir, size_t buffer_size);
void (*get_prebuilt_data_dir_s)(char* dir, size_t buffer_size);
void (*get_staging_dir_s)(char* dir, size_t buffer_size);
void (*get_sync_dir_s)(char* dir, size_t buffer_size);
//! highlight a selection without committing
Bool (*highlight_candidate)(RimeSessionId session_id, size_t index);
//! highlight a selection without committing
Bool (*highlight_candidate_on_current_page)(RimeSessionId session_id,
size_t index);
Bool (*change_page)(RimeSessionId session_id, Bool backward);
} RimeApi; } RimeApi;
//! API entry //! API entry

Binary file not shown.

View file

@ -2,5 +2,5 @@
"cmake": "3.22.1", "cmake": "3.22.1",
"ndk": " 25.2.9519653", "ndk": " 25.2.9519653",
"platform": 23, "platform": 23,
"prebuilder": "1b4b3db05f8cd8486b758ff073bbc4b3b4a2681d" "prebuilder": "1ea929e17c31229265e85603cc8ac5bdb7aab4f2"
} }