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

Unified Diff: src/log-utils.h

Issue 19768003: Logger: remove dependency between Logger and LogMessageBuilder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: header removed Created 7 years, 5 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
« src/log.cc ('K') | « src/log.cc ('k') | src/log-utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log-utils.h
diff --git a/src/log-utils.h b/src/log-utils.h
index c0b863f16c0b7681856dcba14211dd754ee4b022..861a8263b84d80ad74ac71db92cafc0277c1dcce 100644
--- a/src/log-utils.h
+++ b/src/log-utils.h
@@ -68,6 +68,49 @@ class Log {
static const char* const kLogToTemporaryFile;
static const char* const kLogToConsole;
+ // Utility class for formatting log messages. It fills the message into the
+ // static buffer in Log.
+ class MessageBuilder BASE_EMBEDDED {
+ public:
+ // Create a message builder starting from position 0.
+ // This acquires the mutex in the log as well.
+ explicit MessageBuilder(Log* log);
+ ~MessageBuilder() { }
+
+ // Append string data to the log message.
+ void Append(const char* format, ...);
+
+ // Append string data to the log message.
+ void AppendVA(const char* format, va_list args);
+
+ // Append a character to the log message.
+ void Append(const char c);
+
+ // Append double quoted string to the log message.
+ void AppendDoubleQuotedString(const char* string);
+
+ // Append a heap string.
+ void Append(String* str);
+
+ // Appends an address.
+ void AppendAddress(Address addr);
+
+ void AppendSymbolName(Symbol* symbol);
+
+ void AppendDetailed(String* str, bool show_impl_info);
+
+ // Append a portion of a string.
+ void AppendStringPart(const char* str, int len);
+
+ // Write the log message to the log file currently opened.
+ void WriteToLogFile();
+
+ private:
+ Log* log_;
+ ScopedLock sl;
+ int pos_;
+ };
+
private:
explicit Log(Logger* logger);
@@ -108,51 +151,9 @@ class Log {
Logger* logger_;
friend class Logger;
- friend class LogMessageBuilder;
};
-// Utility class for formatting log messages. It fills the message into the
-// static buffer in Log.
-class LogMessageBuilder BASE_EMBEDDED {
- public:
- // Create a message builder starting from position 0. This acquires the mutex
- // in the log as well.
- explicit LogMessageBuilder(Logger* logger);
- ~LogMessageBuilder() { }
-
- // Append string data to the log message.
- void Append(const char* format, ...);
-
- // Append string data to the log message.
- void AppendVA(const char* format, va_list args);
-
- // Append a character to the log message.
- void Append(const char c);
-
- // Append double quoted string to the log message.
- void AppendDoubleQuotedString(const char* string);
-
- // Append a heap string.
- void Append(String* str);
-
- // Appends an address.
- void AppendAddress(Address addr);
-
- void AppendDetailed(String* str, bool show_impl_info);
-
- // Append a portion of a string.
- void AppendStringPart(const char* str, int len);
-
- // Write the log message to the log file currently opened.
- void WriteToLogFile();
-
- private:
- Log* log_;
- ScopedLock sl;
- int pos_;
-};
-
} } // namespace v8::internal
#endif // V8_LOG_UTILS_H_
« src/log.cc ('K') | « src/log.cc ('k') | src/log-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698