diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-06 18:16:31 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-06 18:16:31 +0000 |
commit | fb879b1a74abfb2acf03e54df4ca1035e06d7f55 (patch) | |
tree | 96b172c920aa258d866008d36741c71eba7a4ac8 /base | |
parent | cd405660a90adcf24e7cb204e28d6dfa3a7ea487 (diff) | |
download | chromium_src-fb879b1a74abfb2acf03e54df4ca1035e06d7f55.zip chromium_src-fb879b1a74abfb2acf03e54df4ca1035e06d7f55.tar.gz chromium_src-fb879b1a74abfb2acf03e54df4ca1035e06d7f55.tar.bz2 |
Lower logging for expected errors in process_util_mac.mm
BUG=None
TEST=None
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/logging.h | 21 | ||||
-rw-r--r-- | base/process_util_mac.mm | 4 |
2 files changed, 23 insertions, 2 deletions
diff --git a/base/logging.h b/base/logging.h index b1bc0b0..baf8eb6 100644 --- a/base/logging.h +++ b/base/logging.h @@ -382,6 +382,23 @@ const LogSeverity LOG_0 = LOG_ERROR; LAZY_STREAM(VLOG_STREAM(verbose_level), \ VLOG_IS_ON(verbose_level) && (condition)) +#if defined (OS_WIN) +#define VPLOG_STREAM(verbose_level) \ + logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::logging::GetLastSystemErrorCode()).stream() +#elif defined(OS_POSIX) +#define VPLOG_STREAM(verbose_level) \ + logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::logging::GetLastSystemErrorCode()).stream() +#endif + +#define VPLOG(verbose_level) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) + +#define VPLOG_IF(verbose_level, condition) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), \ + VLOG_IS_ON(verbose_level) && (condition)) + // TODO(akalin): Add more VLOG variants, e.g. VPLOG. #define LOG_ASSERT(condition) \ @@ -539,6 +556,7 @@ DEFINE_CHECK_OP_IMPL(GT, > ) #define DLOG_ASSERT(condition) LOG_ASSERT(condition) #define DPLOG_IF(severity, condition) PLOG_IF(severity, condition) #define DVLOG_IF(verboselevel, condition) VLOG_IF(verboselevel, condition) +#define DVPLOG_IF(verboselevel, condition) VPLOG_IF(verboselevel, condition) #else // ENABLE_DLOG @@ -555,6 +573,7 @@ DEFINE_CHECK_OP_IMPL(GT, > ) #define DLOG_ASSERT(condition) DLOG_EAT_STREAM_PARAMETERS #define DPLOG_IF(severity, condition) DLOG_EAT_STREAM_PARAMETERS #define DVLOG_IF(verboselevel, condition) DLOG_EAT_STREAM_PARAMETERS +#define DVPLOG_IF(verboselevel, condition) DLOG_EAT_STREAM_PARAMETERS #endif // ENABLE_DLOG @@ -589,6 +608,8 @@ enum { DEBUG_MODE = ENABLE_DLOG }; #define DVLOG(verboselevel) DLOG_IF(INFO, VLOG_IS_ON(verboselevel)) +#define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) + // Definitions for DCHECK et al. #if ENABLE_DCHECK diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index 6d05581..39eabac 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -124,13 +124,13 @@ bool ProcessIterator::CheckForNextProcess() { // Find out what size buffer we need. size_t data_len = 0; if (sysctl(mib, arraysize(mib), NULL, &data_len, NULL, 0) < 0) { - LOG(ERROR) << "failed to figure out the buffer size for a commandline"; + DVPLOG(1) << "failed to figure out the buffer size for a commandline"; continue; } data.resize(data_len); if (sysctl(mib, arraysize(mib), &data[0], &data_len, NULL, 0) < 0) { - LOG(ERROR) << "failed to fetch a commandline"; + DVPLOG(1) << "failed to fetch a commandline"; continue; } |