summaryrefslogtreecommitdiffstats
path: root/base/vlog.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 00:39:48 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 00:39:48 +0000
commitb0d38d4c40304f92bf1b06027b225ac807fef702 (patch)
tree588e5dae9930f8ad2e6de6800761975b80325c3e /base/vlog.h
parent41703f7ec3774c1f9766b263ce3e9a93c03c4765 (diff)
downloadchromium_src-b0d38d4c40304f92bf1b06027b225ac807fef702.zip
chromium_src-b0d38d4c40304f92bf1b06027b225ac807fef702.tar.gz
chromium_src-b0d38d4c40304f92bf1b06027b225ac807fef702.tar.bz2
Added support for filtering on the entire pathname to --vmodule.
Also cleaned up spurious warning when --vmodule is used but --v is not. Removed slow perf unittest from vlog_unittest.cc. BUG=61123 TEST=New vlog unittests Review URL: http://codereview.chromium.org/4140007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/vlog.h')
-rw-r--r--base/vlog.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/base/vlog.h b/base/vlog.h
index d4cffe4..1bdeb24 100644
--- a/base/vlog.h
+++ b/base/vlog.h
@@ -8,7 +8,6 @@
#include <cstddef>
#include <string>
-#include <utility>
#include <vector>
#include "base/basictypes.h"
@@ -28,6 +27,11 @@ class VlogInfo {
// E.g. "my_module=2,foo*=3" would change the logging level for all
// code in source files "my_module.*" and "foo*.*" ("-inl" suffixes
// are also disregarded for this matching).
+ //
+ // Any pattern containing a forward or backward slash will be tested
+ // against the whole pathname and not just the module. E.g.,
+ // "*/foo/bar/*=2" would change the logging level for all code in
+ // source files under a "foo/bar" directory.
VlogInfo(const std::string& v_switch,
const std::string& vmodule_switch);
~VlogInfo();
@@ -39,7 +43,19 @@ class VlogInfo {
static const int kDefaultVlogLevel;
private:
- typedef std::pair<std::string, int> VmodulePattern;
+ // VmodulePattern holds all the information for each pattern parsed
+ // from |vmodule_switch|.
+ struct VmodulePattern {
+ enum MatchTarget { MATCH_MODULE, MATCH_FILE };
+
+ explicit VmodulePattern(const std::string& pattern);
+
+ VmodulePattern();
+
+ std::string pattern;
+ int vlog_level;
+ MatchTarget match_target;
+ };
int max_vlog_level_;
std::vector<VmodulePattern> vmodule_levels_;