logging: rename the `DEBUG` log level to `DBG`
[folly.git] / folly / experimental / logging / LogLevel.h
index a3e0e34abf71c6cd8dbba0da8af076e9b916576d..f066fb50942878bb3e56091314306ef92d6811c2 100644 (file)
@@ -40,7 +40,17 @@ enum class LogLevel : uint32_t {
   NONE = 1,
   MIN_LEVEL = 1,
 
-  DEBUG = 900,
+  // "DBG" is the lowest (aka most verbose) debug log level.
+  // This level is intended to be primarily used in log category settings.
+  // In your code it is usually better to use one of the finer-grained DBGn
+  // levels.  In your log category settings you can then set the log category
+  // level to a specific DBGn level, or to to main DBG level to enable all DBGn
+  // messages.
+  //
+  // This is named "DBG" rather than "DEBUG" since some open source projects
+  // define "DEBUG" as a preprocessor macro.
+  DBG = 900,
+
   DBG0 = 1000,
   DBG1 = 999,
   DBG2 = 998,
@@ -56,11 +66,8 @@ enum class LogLevel : uint32_t {
   WARN = 3000,
   WARNING = 3000,
 
-  // Unfortunately Windows headers #define ERROR
-  // On Windows platforms we avoid defining ERROR.  However we make it
-  // available on other platforms, to make it easier to convert code from
-  // other log libraries that also use ERROR as their log level name (e.g.,
-  // glog).
+  // Unfortunately Windows headers #define ERROR, so we cannot use
+  // it as an enum value name.  We only provide ERR instead.
   ERR = 4000,
 
   CRITICAL = 5000,
@@ -124,4 +131,4 @@ inline constexpr bool isLogLevelFatal(LogLevel level) {
   return folly::kIsDebug ? (level >= LogLevel::DFATAL)
                          : (level >= LogLevel::FATAL);
 }
-}
+} // namespace folly