removed windows specific headers
This commit is contained in:
parent
1041a221b8
commit
7d60d6e04b
@ -1,96 +0,0 @@
|
||||
// This file is automatically generated from src/glog/log_severity.h
|
||||
// using src/windows/preprocess.sh.
|
||||
// DO NOT EDIT!
|
||||
|
||||
// Copyright (c) 2007, 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 BASE_LOG_SEVERITY_H__
|
||||
#define BASE_LOG_SEVERITY_H__
|
||||
|
||||
// Annoying stuff for windows -- makes sure clients can import these functions
|
||||
#ifndef GOOGLE_GLOG_DLL_DECL
|
||||
# if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
|
||||
# else
|
||||
# define GOOGLE_GLOG_DLL_DECL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Variables of type LogSeverity are widely taken to lie in the range
|
||||
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
|
||||
// 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,
|
||||
NUM_SEVERITIES = 4;
|
||||
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES
|
||||
# ifdef ERROR
|
||||
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
|
||||
# endif
|
||||
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
|
||||
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL;
|
||||
#endif
|
||||
|
||||
// DFATAL is FATAL in debug mode, ERROR in normal mode
|
||||
#ifdef NDEBUG
|
||||
#define DFATAL_LEVEL ERROR
|
||||
#else
|
||||
#define DFATAL_LEVEL FATAL
|
||||
#endif
|
||||
|
||||
extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES];
|
||||
|
||||
// NDEBUG usage helpers related to (RAW_)DCHECK:
|
||||
//
|
||||
// DEBUG_MODE is for small !NDEBUG uses like
|
||||
// if (DEBUG_MODE) foo.CheckThatFoo();
|
||||
// instead of substantially more verbose
|
||||
// #ifndef NDEBUG
|
||||
// foo.CheckThatFoo();
|
||||
// #endif
|
||||
//
|
||||
// IF_DEBUG_MODE is for small !NDEBUG uses like
|
||||
// IF_DEBUG_MODE( string error; )
|
||||
// DCHECK(Foo(&error)) << error;
|
||||
// instead of substantially more verbose
|
||||
// #ifndef NDEBUG
|
||||
// string error;
|
||||
// DCHECK(Foo(&error)) << error;
|
||||
// #endif
|
||||
//
|
||||
#ifdef NDEBUG
|
||||
enum { DEBUG_MODE = 0 };
|
||||
#define IF_DEBUG_MODE(x)
|
||||
#else
|
||||
enum { DEBUG_MODE = 1 };
|
||||
#define IF_DEBUG_MODE(x) x
|
||||
#endif
|
||||
|
||||
#endif // BASE_LOG_SEVERITY_H__
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,184 +0,0 @@
|
||||
// This file is automatically generated from src/glog/raw_logging.h.in
|
||||
// using src/windows/preprocess.sh.
|
||||
// DO NOT EDIT!
|
||||
|
||||
// Copyright (c) 2006, 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.
|
||||
//
|
||||
// Author: Maxim Lifantsev
|
||||
//
|
||||
// Thread-safe logging routines that do not allocate any memory or
|
||||
// acquire any locks, and can therefore be used by low-level memory
|
||||
// allocation and synchronization code.
|
||||
|
||||
#ifndef BASE_RAW_LOGGING_H_
|
||||
#define BASE_RAW_LOGGING_H_
|
||||
|
||||
#include <time.h>
|
||||
|
||||
namespace google {
|
||||
|
||||
#include "glog/log_severity.h"
|
||||
#include "glog/vlog_is_on.h"
|
||||
|
||||
// Annoying stuff for windows -- makes sure clients can import these functions
|
||||
#ifndef GOOGLE_GLOG_DLL_DECL
|
||||
# if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
|
||||
# else
|
||||
# define GOOGLE_GLOG_DLL_DECL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// This is similar to LOG(severity) << format... and VLOG(level) << format..,
|
||||
// but
|
||||
// * it is to be used ONLY by low-level modules that can't use normal LOG()
|
||||
// * it is desiged to be a low-level logger that does not allocate any
|
||||
// memory and does not need any locks, hence:
|
||||
// * it logs straight and ONLY to STDERR w/o buffering
|
||||
// * it uses an explicit format and arguments list
|
||||
// * it will silently chop off really long message strings
|
||||
// Usage example:
|
||||
// RAW_LOG(ERROR, "Failed foo with %i: %s", status, error);
|
||||
// RAW_VLOG(3, "status is %i", status);
|
||||
// These will print an almost standard log lines like this to stderr only:
|
||||
// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file
|
||||
// I0821 211317 file.cc:142] RAW: status is 20
|
||||
#define RAW_LOG(severity, ...) \
|
||||
do { \
|
||||
switch (google::GLOG_ ## severity) { \
|
||||
case 0: \
|
||||
RAW_LOG_INFO(__VA_ARGS__); \
|
||||
break; \
|
||||
case 1: \
|
||||
RAW_LOG_WARNING(__VA_ARGS__); \
|
||||
break; \
|
||||
case 2: \
|
||||
RAW_LOG_ERROR(__VA_ARGS__); \
|
||||
break; \
|
||||
case 3: \
|
||||
RAW_LOG_FATAL(__VA_ARGS__); \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// The following STRIP_LOG testing is performed in the header file so that it's
|
||||
// possible to completely compile out the logging code and the log messages.
|
||||
#if STRIP_LOG == 0
|
||||
#define RAW_VLOG(verboselevel, ...) \
|
||||
do { \
|
||||
if (VLOG_IS_ON(verboselevel)) { \
|
||||
RAW_LOG_INFO(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__)
|
||||
#endif // STRIP_LOG == 0
|
||||
|
||||
#if STRIP_LOG == 0
|
||||
#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \
|
||||
__FILE__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__)
|
||||
#endif // STRIP_LOG == 0
|
||||
|
||||
#if STRIP_LOG <= 1
|
||||
#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \
|
||||
__FILE__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__)
|
||||
#endif // STRIP_LOG <= 1
|
||||
|
||||
#if STRIP_LOG <= 2
|
||||
#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \
|
||||
__FILE__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__)
|
||||
#endif // STRIP_LOG <= 2
|
||||
|
||||
#if STRIP_LOG <= 3
|
||||
#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \
|
||||
__FILE__, __LINE__, __VA_ARGS__)
|
||||
#else
|
||||
#define RAW_LOG_FATAL(...) \
|
||||
do { \
|
||||
google::RawLogStub__(0, __VA_ARGS__); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
#endif // STRIP_LOG <= 3
|
||||
|
||||
// Similar to CHECK(condition) << message,
|
||||
// but for low-level modules: we use only RAW_LOG that does not allocate memory.
|
||||
// We do not want to provide args list here to encourage this usage:
|
||||
// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args);
|
||||
// so that the args are not computed when not needed.
|
||||
#define RAW_CHECK(condition, message) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// Debug versions of RAW_LOG and RAW_CHECK
|
||||
#ifndef NDEBUG
|
||||
|
||||
#define RAW_DLOG(severity, ...) RAW_LOG(severity, __VA_ARGS__)
|
||||
#define RAW_DCHECK(condition, message) RAW_CHECK(condition, message)
|
||||
|
||||
#else // NDEBUG
|
||||
|
||||
#define RAW_DLOG(severity, ...) \
|
||||
while (false) \
|
||||
RAW_LOG(severity, __VA_ARGS__)
|
||||
#define RAW_DCHECK(condition, message) \
|
||||
while (false) \
|
||||
RAW_CHECK(condition, message)
|
||||
|
||||
#endif // NDEBUG
|
||||
|
||||
// Stub log function used to work around for unused variable warnings when
|
||||
// building with STRIP_LOG > 0.
|
||||
static inline void RawLogStub__(int /* ignored */, ...) {
|
||||
}
|
||||
|
||||
// Helper function to implement RAW_LOG and RAW_VLOG
|
||||
// Logs format... at "severity" level, reporting it
|
||||
// as called from file:line.
|
||||
// This does not allocate memory or acquire locks.
|
||||
GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity,
|
||||
const char* file,
|
||||
int line,
|
||||
const char* format, ...)
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
#endif // BASE_RAW_LOGGING_H_
|
||||
@ -1,224 +0,0 @@
|
||||
// This file is automatically generated from src/glog/stl_logging.h.in
|
||||
// using src/windows/preprocess.sh.
|
||||
// DO NOT EDIT!
|
||||
|
||||
// Copyright (c) 2003, 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.
|
||||
//
|
||||
// Stream output operators for STL containers; to be used for logging *only*.
|
||||
// Inclusion of this file lets you do:
|
||||
//
|
||||
// list<string> x;
|
||||
// LOG(INFO) << "data: " << x;
|
||||
// vector<int> v1, v2;
|
||||
// CHECK_EQ(v1, v2);
|
||||
//
|
||||
// If you want to use this header file with hash_compare 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_
|
||||
#define UTIL_GTL_STL_LOGGING_INL_H_
|
||||
|
||||
#if !1
|
||||
# error We do not support stl_logging for this compiler
|
||||
#endif
|
||||
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef GLOG_STL_LOGGING_FOR_UNORDERED
|
||||
# include <unordered_map>
|
||||
# include <unordered_set>
|
||||
#endif
|
||||
|
||||
#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
|
||||
// operators so that we can recurse from pair -> container -> container -> pair
|
||||
// properly.
|
||||
template<class First, class Second>
|
||||
std::ostream& operator<<(std::ostream& out, const std::pair<First, Second>& p);
|
||||
|
||||
namespace google {
|
||||
|
||||
template<class Iter>
|
||||
void PrintSequence(std::ostream& out, Iter begin, Iter end);
|
||||
|
||||
}
|
||||
|
||||
#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \
|
||||
template<class T1, class T2> \
|
||||
inline std::ostream& operator<<(std::ostream& out, \
|
||||
const Sequence<T1, T2>& seq) { \
|
||||
google::PrintSequence(out, seq.begin(), seq.end()); \
|
||||
return out; \
|
||||
}
|
||||
|
||||
OUTPUT_TWO_ARG_CONTAINER(std::vector)
|
||||
OUTPUT_TWO_ARG_CONTAINER(std::deque)
|
||||
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
|
||||
|
||||
#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \
|
||||
template<class T1, class T2, class T3> \
|
||||
inline std::ostream& operator<<(std::ostream& out, \
|
||||
const Sequence<T1, T2, T3>& seq) { \
|
||||
google::PrintSequence(out, seq.begin(), seq.end()); \
|
||||
return out; \
|
||||
}
|
||||
|
||||
OUTPUT_THREE_ARG_CONTAINER(std::set)
|
||||
OUTPUT_THREE_ARG_CONTAINER(std::multiset)
|
||||
|
||||
#undef OUTPUT_THREE_ARG_CONTAINER
|
||||
|
||||
#define OUTPUT_FOUR_ARG_CONTAINER(Sequence) \
|
||||
template<class T1, class T2, class T3, class T4> \
|
||||
inline std::ostream& operator<<(std::ostream& out, \
|
||||
const Sequence<T1, T2, T3, T4>& seq) { \
|
||||
google::PrintSequence(out, seq.begin(), seq.end()); \
|
||||
return out; \
|
||||
}
|
||||
|
||||
OUTPUT_FOUR_ARG_CONTAINER(std::map)
|
||||
OUTPUT_FOUR_ARG_CONTAINER(std::multimap)
|
||||
#ifdef GLOG_STL_LOGGING_FOR_UNORDERED
|
||||
OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set)
|
||||
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
|
||||
|
||||
#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \
|
||||
template<class T1, class T2, class T3, class T4, class T5> \
|
||||
inline std::ostream& operator<<(std::ostream& out, \
|
||||
const Sequence<T1, T2, T3, T4, T5>& seq) { \
|
||||
google::PrintSequence(out, seq.begin(), seq.end()); \
|
||||
return out; \
|
||||
}
|
||||
|
||||
#ifdef GLOG_STL_LOGGING_FOR_UNORDERED
|
||||
OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map)
|
||||
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
|
||||
|
||||
template<class First, class Second>
|
||||
inline std::ostream& operator<<(std::ostream& out,
|
||||
const std::pair<First, Second>& p) {
|
||||
out << '(' << p.first << ", " << p.second << ')';
|
||||
return out;
|
||||
}
|
||||
|
||||
namespace google {
|
||||
|
||||
template<class Iter>
|
||||
inline void PrintSequence(std::ostream& out, Iter begin, Iter end) {
|
||||
// Output at most 100 elements -- appropriate if used for logging.
|
||||
for (int i = 0; begin != end && i < 100; ++i, ++begin) {
|
||||
if (i > 0) out << ' ';
|
||||
out << *begin;
|
||||
}
|
||||
if (begin != end) {
|
||||
out << " ...";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 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
|
||||
// types which are themselves defined with this namespace. Without this, these
|
||||
// operator overloads cannot be found via ADL. If these definitions are not
|
||||
// found via ADL, they must be #included before they're used, which requires
|
||||
// this header to be included before apparently independent other headers.
|
||||
//
|
||||
// For example, base/logging.h defines various template functions to implement
|
||||
// CHECK_EQ(x, y) and stream x and y into the log in the event the check fails.
|
||||
// It does so via the function template MakeCheckOpValueString:
|
||||
// template<class T>
|
||||
// void MakeCheckOpValueString(strstream* ss, const T& v) {
|
||||
// (*ss) << v;
|
||||
// }
|
||||
// Because 'glog/logging.h' is included before 'glog/stl_logging.h',
|
||||
// subsequent CHECK_EQ(v1, v2) for vector<...> typed variable v1 and v2 can only
|
||||
// find these operator definitions via ADL.
|
||||
//
|
||||
// Even this solution has problems -- it may pull unintended operators into the
|
||||
// namespace as well, allowing them to also be found via ADL, and creating code
|
||||
// that only works with a particular order of includes. Long term, we need to
|
||||
// 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
|
||||
// in both because that would create ambiguous overloads when both are found.
|
||||
namespace std { using ::operator<<; }
|
||||
|
||||
#endif // UTIL_GTL_STL_LOGGING_INL_H_
|
||||
@ -1,126 +0,0 @@
|
||||
// This file is automatically generated from src/glog/vlog_is_on.h.in
|
||||
// using src/windows/preprocess.sh.
|
||||
// DO NOT EDIT!
|
||||
|
||||
// Copyright (c) 1999, 2007, 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.
|
||||
//
|
||||
// Author: Ray Sidney and many others
|
||||
//
|
||||
// Defines the VLOG_IS_ON macro that controls the variable-verbosity
|
||||
// conditional logging.
|
||||
//
|
||||
// It's used by VLOG and VLOG_IF in logging.h
|
||||
// and by RAW_VLOG in raw_logging.h to trigger the logging.
|
||||
//
|
||||
// It can also be used directly e.g. like this:
|
||||
// if (VLOG_IS_ON(2)) {
|
||||
// // do some logging preparation and logging
|
||||
// // that can't be accomplished e.g. via just VLOG(2) << ...;
|
||||
// }
|
||||
//
|
||||
// The truth value that VLOG_IS_ON(level) returns is determined by
|
||||
// the three verbosity level flags:
|
||||
// --v=<n> Gives the default maximal active V-logging level;
|
||||
// 0 is the default.
|
||||
// Normally positive values are used for V-logging levels.
|
||||
// --vmodule=<str> Gives the per-module maximal V-logging levels to override
|
||||
// the value given by --v.
|
||||
// E.g. "my_module=2,foo*=3" would change the logging level
|
||||
// for all code in source files "my_module.*" and "foo*.*"
|
||||
// ("-inl" suffixes are also disregarded for this matching).
|
||||
//
|
||||
// SetVLOGLevel helper function is provided to do limited dynamic control over
|
||||
// V-logging by overriding the per-module settings given via --vmodule flag.
|
||||
//
|
||||
// CAVEAT: --vmodule functionality is not available in non gcc compilers.
|
||||
//
|
||||
|
||||
#ifndef BASE_VLOG_IS_ON_H_
|
||||
#define BASE_VLOG_IS_ON_H_
|
||||
|
||||
#include "glog/log_severity.h"
|
||||
|
||||
// Annoying stuff for windows -- makes sure clients can import these functions
|
||||
#ifndef GOOGLE_GLOG_DLL_DECL
|
||||
# if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
|
||||
# else
|
||||
# define GOOGLE_GLOG_DLL_DECL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
|
||||
// (Normally) the first time every VLOG_IS_ON(n) site is hit,
|
||||
// we determine what variable will dynamically control logging at this site:
|
||||
// it's either FLAGS_v or an appropriate internal variable
|
||||
// matching the current source file that represents results of
|
||||
// parsing of --vmodule flag and/or SetVLOGLevel calls.
|
||||
#define VLOG_IS_ON(verboselevel) \
|
||||
__extension__ \
|
||||
({ static @ac_google_namespace@::int32* vlocal__ = NULL; \
|
||||
google::int32 verbose_level__ = (verboselevel); \
|
||||
(vlocal__ == NULL ? @ac_google_namespace@::InitVLOG3__(&vlocal__, &FLAGS_v, \
|
||||
__FILE__, verbose_level__) : *vlocal__ >= verbose_level__); \
|
||||
})
|
||||
#else
|
||||
// GNU extensions not available, so we do not support --vmodule.
|
||||
// Dynamic value of FLAGS_v always controls the logging level.
|
||||
#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
|
||||
#endif
|
||||
|
||||
// Set VLOG(_IS_ON) level for module_pattern to log_level.
|
||||
// This lets us dynamically control what is normally set by the --vmodule flag.
|
||||
// Returns the level that previously applied to module_pattern.
|
||||
// NOTE: To change the log level for VLOG(_IS_ON) sites
|
||||
// that have already executed after/during InitGoogleLogging,
|
||||
// one needs to supply the exact --vmodule pattern that applied to them.
|
||||
// (If no --vmodule pattern applied to them
|
||||
// the value of FLAGS_v will continue to control them.)
|
||||
extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern,
|
||||
int log_level);
|
||||
|
||||
// Various declarations needed for VLOG_IS_ON above: =========================
|
||||
|
||||
// Helper routine which determines the logging info for a particalur VLOG site.
|
||||
// site_flag is the address of the site-local pointer to the controlling
|
||||
// verbosity level
|
||||
// site_default is the default to use for *site_flag
|
||||
// fname is the current source file name
|
||||
// verbose_level is the argument to VLOG_IS_ON
|
||||
// We will return the return value for VLOG_IS_ON
|
||||
// and if possible set *site_flag appropriately.
|
||||
extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__(
|
||||
google::int32** site_flag,
|
||||
google::int32* site_default,
|
||||
const char* fname,
|
||||
google::int32 verbose_level);
|
||||
|
||||
#endif // BASE_VLOG_IS_ON_H_
|
||||
Loading…
Reference in New Issue
Block a user