|
Packit Service |
9def5d |
// Copyright (c) 2007, Google Inc.
|
|
Packit Service |
9def5d |
// All rights reserved.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// Redistribution and use in source and binary forms, with or without
|
|
Packit Service |
9def5d |
// modification, are permitted provided that the following conditions are
|
|
Packit Service |
9def5d |
// met:
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// * Redistributions of source code must retain the above copyright
|
|
Packit Service |
9def5d |
// notice, this list of conditions and the following disclaimer.
|
|
Packit Service |
9def5d |
// * Redistributions in binary form must reproduce the above
|
|
Packit Service |
9def5d |
// copyright notice, this list of conditions and the following disclaimer
|
|
Packit Service |
9def5d |
// in the documentation and/or other materials provided with the
|
|
Packit Service |
9def5d |
// distribution.
|
|
Packit Service |
9def5d |
// * Neither the name of Google Inc. nor the names of its
|
|
Packit Service |
9def5d |
// contributors may be used to endorse or promote products derived from
|
|
Packit Service |
9def5d |
// this software without specific prior written permission.
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit Service |
9def5d |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit Service |
9def5d |
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
Packit Service |
9def5d |
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
Packit Service |
9def5d |
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
Packit Service |
9def5d |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
Packit Service |
9def5d |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
Packit Service |
9def5d |
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
Packit Service |
9def5d |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Packit Service |
9def5d |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit Service |
9def5d |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#ifndef BASE_LOG_SEVERITY_H__
|
|
Packit Service |
9def5d |
#define BASE_LOG_SEVERITY_H__
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Annoying stuff for windows -- makes sure clients can import these functions
|
|
Packit Service |
9def5d |
#ifndef GOOGLE_GLOG_DLL_DECL
|
|
Packit Service |
9def5d |
# if defined(_WIN32) && !defined(__CYGWIN__)
|
|
Packit Service |
9def5d |
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
|
|
Packit Service |
9def5d |
# else
|
|
Packit Service |
9def5d |
# define GOOGLE_GLOG_DLL_DECL
|
|
Packit Service |
9def5d |
# endif
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// Variables of type LogSeverity are widely taken to lie in the range
|
|
Packit Service |
9def5d |
// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
|
|
Packit Service |
9def5d |
// you ever need to change their values or add a new severity.
|
|
Packit Service |
9def5d |
typedef int LogSeverity;
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3,
|
|
Packit Service |
9def5d |
NUM_SEVERITIES = 4;
|
|
Packit Service |
9def5d |
#ifndef GLOG_NO_ABBREVIATED_SEVERITIES
|
|
Packit Service |
9def5d |
# ifdef ERROR
|
|
Packit Service |
9def5d |
# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
|
|
Packit Service |
9def5d |
# endif
|
|
Packit Service |
9def5d |
const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
|
|
Packit Service |
9def5d |
ERROR = GLOG_ERROR, FATAL = GLOG_FATAL;
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// DFATAL is FATAL in debug mode, ERROR in normal mode
|
|
Packit Service |
9def5d |
#ifdef NDEBUG
|
|
Packit Service |
9def5d |
#define DFATAL_LEVEL ERROR
|
|
Packit Service |
9def5d |
#else
|
|
Packit Service |
9def5d |
#define DFATAL_LEVEL FATAL
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES];
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
// NDEBUG usage helpers related to (RAW_)DCHECK:
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// DEBUG_MODE is for small !NDEBUG uses like
|
|
Packit Service |
9def5d |
// if (DEBUG_MODE) foo.CheckThatFoo();
|
|
Packit Service |
9def5d |
// instead of substantially more verbose
|
|
Packit Service |
9def5d |
// #ifndef NDEBUG
|
|
Packit Service |
9def5d |
// foo.CheckThatFoo();
|
|
Packit Service |
9def5d |
// #endif
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
// IF_DEBUG_MODE is for small !NDEBUG uses like
|
|
Packit Service |
9def5d |
// IF_DEBUG_MODE( string error; )
|
|
Packit Service |
9def5d |
// DCHECK(Foo(&error)) << error;
|
|
Packit Service |
9def5d |
// instead of substantially more verbose
|
|
Packit Service |
9def5d |
// #ifndef NDEBUG
|
|
Packit Service |
9def5d |
// string error;
|
|
Packit Service |
9def5d |
// DCHECK(Foo(&error)) << error;
|
|
Packit Service |
9def5d |
// #endif
|
|
Packit Service |
9def5d |
//
|
|
Packit Service |
9def5d |
#ifdef NDEBUG
|
|
Packit Service |
9def5d |
enum { DEBUG_MODE = 0 };
|
|
Packit Service |
9def5d |
#define IF_DEBUG_MODE(x)
|
|
Packit Service |
9def5d |
#else
|
|
Packit Service |
9def5d |
enum { DEBUG_MODE = 1 };
|
|
Packit Service |
9def5d |
#define IF_DEBUG_MODE(x) x
|
|
Packit Service |
9def5d |
#endif
|
|
Packit Service |
9def5d |
|
|
Packit Service |
9def5d |
#endif // BASE_LOG_SEVERITY_H__
|