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

Unified Diff: chrome/test/chromedriver/chrome/log.h

Issue 23566018: [chromedriver] Remove Logger and just use base LOG. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 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 | « chrome/test/chromedriver/chrome/devtools_http_client.cc ('k') | chrome/test/chromedriver/chrome/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/log.h
diff --git a/chrome/test/chromedriver/chrome/log.h b/chrome/test/chromedriver/chrome/log.h
index db2eb2658715c94261a85f3eac2f2673e8174217..a995f390ccd748a609ec921a63f83a92eeaafb85 100644
--- a/chrome/test/chromedriver/chrome/log.h
+++ b/chrome/test/chromedriver/chrome/log.h
@@ -10,15 +10,21 @@
#include "base/compiler_specific.h"
#include "base/time/time.h"
+namespace base {
+class Value;
+}
+
// Abstract class for logging entries with a level, timestamp, string message.
class Log {
public:
// Log entry severity level.
enum Level {
+ kAll,
kDebug,
- kLog,
+ kInfo,
kWarning,
- kError
+ kError,
+ kOff
};
virtual ~Log() {}
@@ -32,21 +38,18 @@ class Log {
void AddEntry(Level level, const std::string& message);
};
-// Writes log entries using printf.
-class Logger : public Log {
- public:
- // Creates a logger with a minimum level of |kDebug|.
- Logger();
- explicit Logger(Level min_log_level);
- virtual ~Logger();
+typedef bool (*IsVLogOnFunc)(int vlog_level);
+void InitLogging(IsVLogOnFunc is_vlog_on_func);
- virtual void AddEntryTimestamped(const base::Time& timestamp,
- Level level,
- const std::string& message) OVERRIDE;
+// Returns whether the given VLOG level is on.
+bool IsVLogOn(int vlog_level);
- private:
- Level min_log_level_;
- base::Time start_;
-};
+std::string PrettyPrintValue(const base::Value& value);
+
+// Returns a pretty printed value, after truncating long strings.
+std::string FormatValueForDisplay(const base::Value& value);
+
+// Returns a pretty printed json string, after truncating long strings.
+std::string FormatJsonForDisplay(const std::string& json);
#endif // CHROME_TEST_CHROMEDRIVER_CHROME_LOG_H_
« no previous file with comments | « chrome/test/chromedriver/chrome/devtools_http_client.cc ('k') | chrome/test/chromedriver/chrome/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698