log_severity.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // This file is automatically generated from src/glog/log_severity.h
  2. // using src/windows/preprocess.sh.
  3. // DO NOT EDIT!
  4. // Copyright (c) 2007, Google Inc.
  5. // All rights reserved.
  6. //
  7. // Redistribution and use in source and binary forms, with or without
  8. // modification, are permitted provided that the following conditions are
  9. // met:
  10. //
  11. // * Redistributions of source code must retain the above copyright
  12. // notice, this list of conditions and the following disclaimer.
  13. // * Redistributions in binary form must reproduce the above
  14. // copyright notice, this list of conditions and the following disclaimer
  15. // in the documentation and/or other materials provided with the
  16. // distribution.
  17. // * Neither the name of Google Inc. nor the names of its
  18. // contributors may be used to endorse or promote products derived from
  19. // this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. #ifndef BASE_LOG_SEVERITY_H__
  33. #define BASE_LOG_SEVERITY_H__
  34. // Annoying stuff for windows -- makes sure clients can import these functions
  35. #ifndef GOOGLE_GLOG_DLL_DECL
  36. # if defined(_WIN32) && !defined(__CYGWIN__)
  37. # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
  38. # else
  39. # define GOOGLE_GLOG_DLL_DECL
  40. # endif
  41. #endif
  42. // Variables of type LogSeverity are widely taken to lie in the range
  43. // [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if
  44. // you ever need to change their values or add a new severity.
  45. typedef int LogSeverity;
  46. const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3,
  47. NUM_SEVERITIES = 4;
  48. #ifndef GLOG_NO_ABBREVIATED_SEVERITIES
  49. # ifdef ERROR
  50. # error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail.
  51. # endif
  52. const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
  53. ERROR = GLOG_ERROR, FATAL = GLOG_FATAL;
  54. #endif
  55. // DFATAL is FATAL in debug mode, ERROR in normal mode
  56. #ifdef NDEBUG
  57. #define DFATAL_LEVEL ERROR
  58. #else
  59. #define DFATAL_LEVEL FATAL
  60. #endif
  61. extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES];
  62. // NDEBUG usage helpers related to (RAW_)DCHECK:
  63. //
  64. // DEBUG_MODE is for small !NDEBUG uses like
  65. // if (DEBUG_MODE) foo.CheckThatFoo();
  66. // instead of substantially more verbose
  67. // #ifndef NDEBUG
  68. // foo.CheckThatFoo();
  69. // #endif
  70. //
  71. // IF_DEBUG_MODE is for small !NDEBUG uses like
  72. // IF_DEBUG_MODE( string error; )
  73. // DCHECK(Foo(&error)) << error;
  74. // instead of substantially more verbose
  75. // #ifndef NDEBUG
  76. // string error;
  77. // DCHECK(Foo(&error)) << error;
  78. // #endif
  79. //
  80. #ifdef NDEBUG
  81. enum { DEBUG_MODE = 0 };
  82. #define IF_DEBUG_MODE(x)
  83. #else
  84. enum { DEBUG_MODE = 1 };
  85. #define IF_DEBUG_MODE(x) x
  86. #endif
  87. #endif // BASE_LOG_SEVERITY_H__