Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3194)

Unified Diff: base/vlog.h

Issue 3448028: Implemented VLOG() et al. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Addressed evmar's comments Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util.cc ('k') | base/vlog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/vlog.h
diff --git a/base/vlog.h b/base/vlog.h
new file mode 100644
index 0000000000000000000000000000000000000000..faa62ecaa73758c4ee1e6f20196a6cc21774b2ad
--- /dev/null
+++ b/base/vlog.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_VLOG_H_
+#define BASE_VLOG_H_
+#pragma once
+
+#include <cstddef>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/string_piece.h"
+
+namespace logging {
+
+// A helper class containing all the settings for vlogging.
+class VlogInfo {
+ public:
+ // |v_switch| gives the default maximal active V-logging level; 0 is
+ // the default. Normally positive values are used for V-logging
+ // levels.
+ //
+ // |vmodule_switch| gives the per-module maximal V-logging levels to
+ // override the value given by |v_switch|.
+ // 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).
+ VlogInfo(const std::string& v_switch,
+ const std::string& vmodule_switch);
+
+ // Returns the vlog level for a given file (usually taken from
+ // __FILE__).
+ int GetVlogLevel(const base::StringPiece& file);
+
+ static const int kDefaultVlogLevel;
+
+ private:
+ typedef std::pair<std::string, int> VmodulePattern;
+
+ int max_vlog_level_;
+ std::vector<VmodulePattern> vmodule_levels_;
+
+ DISALLOW_COPY_AND_ASSIGN(VlogInfo);
+};
+
+} // namespace logging
+
+#endif // BASE_VLOG_H_
« no previous file with comments | « base/string_util.cc ('k') | base/vlog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698