diff options
author | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 15:50:49 +0000 |
---|---|---|
committer | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 15:50:49 +0000 |
commit | 162ac0f02a2a7a6f1909a85a222ab5da3d280d12 (patch) | |
tree | ccc49648b2197f598acaeafa4d4f58c0c0048bdd /base/vlog.h | |
parent | ce833284bfd1b0a5db62e0f3c25f48af70ae8784 (diff) | |
download | chromium_src-162ac0f02a2a7a6f1909a85a222ab5da3d280d12.zip chromium_src-162ac0f02a2a7a6f1909a85a222ab5da3d280d12.tar.gz chromium_src-162ac0f02a2a7a6f1909a85a222ab5da3d280d12.tar.bz2 |
Integrate ETW with VLOG logging.
This change extends the log severities into the negative for VLOG verbosities.
It also keeps track of file/line information and passes it to any registered log handler.
The log level is naturally controlled by translating ETW log levels to the severities.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4164011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/vlog.h')
-rw-r--r-- | base/vlog.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/base/vlog.h b/base/vlog.h index 428b3e1..529afd5 100644 --- a/base/vlog.h +++ b/base/vlog.h @@ -28,21 +28,29 @@ class VlogInfo { // code in source files "my_module.*" and "foo*.*" ("-inl" suffixes // are also disregarded for this matching). // + // |log_severity| points to an int that stores the log level. If a valid + // |v_switch| is provided, it will set the log level, and the default + // vlog severity will be read from there.. + // // 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); + const std::string& vmodule_switch, + int* min_log_level); ~VlogInfo(); // Returns the vlog level for a given file (usually taken from // __FILE__). - int GetVlogLevel(const base::StringPiece& file); + int GetVlogLevel(const base::StringPiece& file) const; static const int kDefaultVlogLevel; private: + void SetMaxVlogLevel(int level); + int GetMaxVlogLevel() const; + // VmodulePattern holds all the information for each pattern parsed // from |vmodule_switch|. struct VmodulePattern { @@ -57,8 +65,8 @@ class VlogInfo { MatchTarget match_target; }; - int max_vlog_level_; std::vector<VmodulePattern> vmodule_levels_; + int* min_log_level_; DISALLOW_COPY_AND_ASSIGN(VlogInfo); }; |