summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 19:28:07 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 19:28:07 +0000
commit909116fdb8f7eaaf225bdf3314fdf4e46d42f115 (patch)
tree48e13a067667ee3ed6e3103ff0cc6d1355043dba /base
parentead68fa16bb57be280d19b30e6b592fd8f6192a0 (diff)
downloadchromium_src-909116fdb8f7eaaf225bdf3314fdf4e46d42f115.zip
chromium_src-909116fdb8f7eaaf225bdf3314fdf4e46d42f115.tar.gz
chromium_src-909116fdb8f7eaaf225bdf3314fdf4e46d42f115.tar.bz2
Fixed logging so that vmodule works correctly again
Removed extraneous check in LogMessage destructor; all the checks are now done before LogMessage is created. Removed useless warning if --vmodule is used but --v is not. BUG=None TEST=Manual Review URL: http://codereview.chromium.org/5329001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/debug/leak_tracker.h6
-rw-r--r--base/logging.cc6
-rw-r--r--base/vlog.cc2
3 files changed, 5 insertions, 9 deletions
diff --git a/base/debug/leak_tracker.h b/base/debug/leak_tracker.h
index 8af82a9..9709aa1 100644
--- a/base/debug/leak_tracker.h
+++ b/base/debug/leak_tracker.h
@@ -91,8 +91,10 @@ class LeakTracker : public LinkNode<LeakTracker<T> > {
stacktraces[count] = allocation_stack;
++count;
- LOG(ERROR) << "Leaked " << node << " which was allocated by:";
- allocation_stack.OutputToStream(&LOG_STREAM(ERROR));
+ if (LOG_IS_ON(ERROR)) {
+ LOG_STREAM(ERROR) << "Leaked " << node << " which was allocated by:";
+ allocation_stack.OutputToStream(&LOG_STREAM(ERROR));
+ }
}
CHECK_EQ(0u, count);
diff --git a/base/logging.cc b/base/logging.cc
index 74f9a87..e3cedc7 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -596,12 +596,6 @@ void LogMessage::Init(const char* file, int line) {
}
LogMessage::~LogMessage() {
- // The macros in logging.h should already avoid creating LogMessages
- // when this holds, but it's possible that users create LogMessages
- // directly (e.g., using LOG_STREAM() directly).
- if (severity_ < min_log_level)
- return;
-
#ifndef NDEBUG
if (severity_ == LOG_FATAL) {
// Include a stack trace on a fatal.
diff --git a/base/vlog.cc b/base/vlog.cc
index cda9cea..aca8d0f 100644
--- a/base/vlog.cc
+++ b/base/vlog.cc
@@ -36,7 +36,7 @@ VlogInfo::VlogInfo(const std::string& v_switch,
typedef std::pair<std::string, std::string> KVPair;
int vlog_level = 0;
- if (base::StringToInt(v_switch, &vlog_level)) {
+ if (!v_switch.empty() && base::StringToInt(v_switch, &vlog_level)) {
SetMaxVlogLevel(vlog_level);
} else {
LOG(WARNING) << "Parsed v switch \""