implement VLOG(x)

This commit is contained in:
lperron@google.com
2011-12-08 16:48:29 +00:00
parent 09487025a8
commit bc64d8cc9b
2 changed files with 6 additions and 1 deletions

View File

@@ -16,6 +16,8 @@
#include "base/logging.h"
DEFINE_int32(log_level, 0, "Log level (0 is the default).");
namespace operations_research {
DateLogger::DateLogger() {
#if defined(_MSC_VER)

View File

@@ -17,8 +17,11 @@
#include <assert.h>
#include <stdlib.h>
#include <iostream> // NOLINT
#include "base/commandlineflags.h"
#include "base/macros.h"
DECLARE_int32(log_level);
// Debug-only checking.
#define DCHECK(condition) assert(condition)
#define DCHECK_EQ(val1, val2) assert((val1) == (val2))
@@ -45,7 +48,7 @@
#define LOG_FATAL LogMessageFatal(__FILE__, __LINE__)
#define LOG_QFATAL LOG_FATAL
#define VLOG(x) if ((x) <= 0) LOG_INFO.stream()
#define VLOG(x) if ((x) <= FLAGS_log_level) LOG_INFO.stream()
#ifdef NDEBUG
#define DEBUG_MODE 0