| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_VLOG_H_ | 5 #ifndef BASE_VLOG_H_ |
| 6 #define BASE_VLOG_H_ | 6 #define BASE_VLOG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // the default. Normally positive values are used for V-logging | 23 // the default. Normally positive values are used for V-logging |
| 24 // levels. | 24 // levels. |
| 25 // | 25 // |
| 26 // |vmodule_switch| gives the per-module maximal V-logging levels to | 26 // |vmodule_switch| gives the per-module maximal V-logging levels to |
| 27 // override the value given by |v_switch|. | 27 // override the value given by |v_switch|. |
| 28 // E.g. "my_module=2,foo*=3" would change the logging level for all | 28 // E.g. "my_module=2,foo*=3" would change the logging level for all |
| 29 // code in source files "my_module.*" and "foo*.*" ("-inl" suffixes | 29 // code in source files "my_module.*" and "foo*.*" ("-inl" suffixes |
| 30 // are also disregarded for this matching). | 30 // are also disregarded for this matching). |
| 31 VlogInfo(const std::string& v_switch, | 31 VlogInfo(const std::string& v_switch, |
| 32 const std::string& vmodule_switch); | 32 const std::string& vmodule_switch); |
| 33 ~VlogInfo(); |
| 33 | 34 |
| 34 // Returns the vlog level for a given file (usually taken from | 35 // Returns the vlog level for a given file (usually taken from |
| 35 // __FILE__). | 36 // __FILE__). |
| 36 int GetVlogLevel(const base::StringPiece& file); | 37 int GetVlogLevel(const base::StringPiece& file); |
| 37 | 38 |
| 38 static const int kDefaultVlogLevel; | 39 static const int kDefaultVlogLevel; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 typedef std::pair<std::string, int> VmodulePattern; | 42 typedef std::pair<std::string, int> VmodulePattern; |
| 42 | 43 |
| 43 int max_vlog_level_; | 44 int max_vlog_level_; |
| 44 std::vector<VmodulePattern> vmodule_levels_; | 45 std::vector<VmodulePattern> vmodule_levels_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(VlogInfo); | 47 DISALLOW_COPY_AND_ASSIGN(VlogInfo); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace logging | 50 } // namespace logging |
| 50 | 51 |
| 51 #endif // BASE_VLOG_H_ | 52 #endif // BASE_VLOG_H_ |
| OLD | NEW |