void Logger::ProfilerBeginEvent() {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("profiler,\"begin\",%d\n", kSamplingIntervalMs);
+ msg.Append("profiler,\"begin\",%d", kSamplingIntervalMs);
msg.WriteToLogFile();
}
void Logger::UncheckedStringEvent(const char* name, const char* value) {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,\"%s\"\n", name, value);
+ msg.Append("%s,\"%s\"", name, value);
msg.WriteToLogFile();
}
void Logger::UncheckedIntEvent(const char* name, int value) {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,%d\n", name, value);
+ msg.Append("%s,%d", name, value);
msg.WriteToLogFile();
}
void Logger::UncheckedIntPtrTEvent(const char* name, intptr_t value) {
if (!log_->IsEnabled()) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,%" V8_PTR_PREFIX "d\n", name, value);
+ msg.Append("%s,%" V8_PTR_PREFIX "d", name, value);
msg.WriteToLogFile();
}
void Logger::HandleEvent(const char* name, Object** location) {
if (!log_->IsEnabled() || !FLAG_log_handles) return;
Log::MessageBuilder msg(log_);
- msg.Append("%s,0x%" V8PRIxPTR "\n", name, location);
+ msg.Append("%s,0x%" V8PRIxPTR, name, location);
msg.WriteToLogFile();
}
if (key->IsString()) {
SmartArrayPointer<char> str =
String::cast(key)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,check-security,\"%s\"\n", str.get());
+ ApiEvent("api,check-security,\"%s\"", str.get());
} else if (key->IsSymbol()) {
Symbol* symbol = Symbol::cast(key);
if (symbol->name()->IsUndefined()) {
- ApiEvent("api,check-security,symbol(hash %x)\n",
- Symbol::cast(key)->Hash());
+ ApiEvent("api,check-security,symbol(hash %x)", Symbol::cast(key)->Hash());
} else {
SmartArrayPointer<char> str = String::cast(symbol->name())->ToCString(
DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,check-security,symbol(\"%s\" hash %x)\n",
- str.get(),
+ ApiEvent("api,check-security,symbol(\"%s\" hash %x)", str.get(),
Symbol::cast(key)->Hash());
}
} else if (key->IsUndefined()) {
- ApiEvent("api,check-security,undefined\n");
+ ApiEvent("api,check-security,undefined");
} else {
- ApiEvent("api,check-security,['no-name']\n");
+ ApiEvent("api,check-security,['no-name']");
}
}
uintptr_t end) {
if (!log_->IsEnabled() || !FLAG_prof) return;
Log::MessageBuilder msg(log_);
- msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n",
- library_path.c_str(),
- start,
- end);
+ msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR,
+ library_path.c_str(), start, end);
msg.WriteToLogFile();
}
ASSERT(FLAG_log_internal_timer_events);
Log::MessageBuilder msg(log_);
int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
- msg.Append("code-deopt,%ld,%d\n", since_epoch, code->CodeSize());
+ msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize());
msg.WriteToLogFile();
}
ASSERT(FLAG_log_internal_timer_events);
Log::MessageBuilder msg(log_);
int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
- msg.Append("current-time,%ld\n", since_epoch);
+ msg.Append("current-time,%ld", since_epoch);
msg.WriteToLogFile();
}
ASSERT(FLAG_log_internal_timer_events);
Log::MessageBuilder msg(log_);
int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
- const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n"
- : "timer-event-end,\"%s\",%ld\n";
+ const char* format = (se == START) ? "timer-event-start,\"%s\",%ld"
+ : "timer-event-end,\"%s\",%ld";
msg.Append(format, name, since_epoch);
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
msg.Append("regexp-compile,");
LogRegExpSource(regexp);
- msg.Append(in_cache ? ",hit\n" : ",miss\n");
+ msg.Append(in_cache ? ",hit" : ",miss");
msg.WriteToLogFile();
}
void Logger::ApiIndexedSecurityCheck(uint32_t index) {
if (!log_->IsEnabled() || !FLAG_log_api) return;
- ApiEvent("api,check-security,%u\n", index);
+ ApiEvent("api,check-security,%u", index);
}
if (name->IsString()) {
SmartArrayPointer<char> property_name =
String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,%s,\"%s\",\"%s\"\n", tag, class_name.get(),
+ ApiEvent("api,%s,\"%s\",\"%s\"", tag, class_name.get(),
property_name.get());
} else {
Symbol* symbol = Symbol::cast(name);
uint32_t hash = symbol->Hash();
if (symbol->name()->IsUndefined()) {
- ApiEvent("api,%s,\"%s\",symbol(hash %x)\n", tag, class_name.get(), hash);
+ ApiEvent("api,%s,\"%s\",symbol(hash %x)", tag, class_name.get(), hash);
} else {
SmartArrayPointer<char> str = String::cast(symbol->name())->ToCString(
DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,%s,\"%s\",symbol(\"%s\" hash %x)\n",
- tag, class_name.get(), str.get(), hash);
+ ApiEvent("api,%s,\"%s\",symbol(\"%s\" hash %x)", tag, class_name.get(),
+ str.get(), hash);
}
}
}
String* class_name_obj = holder->class_name();
SmartArrayPointer<char> class_name =
class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,%s,\"%s\",%u\n", tag, class_name.get(), index);
+ ApiEvent("api,%s,\"%s\",%u", tag, class_name.get(), index);
}
String* class_name_obj = object->class_name();
SmartArrayPointer<char> class_name =
class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
- ApiEvent("api,%s,\"%s\"\n", tag, class_name.get());
+ ApiEvent("api,%s,\"%s\"", tag, class_name.get());
}
void Logger::ApiEntryCall(const char* name) {
if (!log_->IsEnabled() || !FLAG_log_api) return;
- ApiEvent("api,%s\n", name);
+ ApiEvent("api,%s", name);
}
void Logger::NewEvent(const char* name, void* object, size_t size) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("new,%s,0x%" V8PRIxPTR ",%u\n", name, object,
+ msg.Append("new,%s,0x%" V8PRIxPTR ",%u", name, object,
static_cast<unsigned int>(size));
msg.WriteToLogFile();
}
void Logger::DeleteEvent(const char* name, void* object) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("delete,%s,0x%" V8PRIxPTR "\n", name, object);
+ msg.Append("delete,%s,0x%" V8PRIxPTR, name, object);
msg.WriteToLogFile();
}
symbol->Hash());
}
}
- msg.Append('\n');
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
AppendCodeCreateHeader(&msg, tag, code);
msg.AppendDoubleQuotedString(comment);
- msg.Append('\n');
msg.WriteToLogFile();
}
} else {
msg.AppendSymbolName(Symbol::cast(name));
}
- msg.Append('\n');
msg.WriteToLogFile();
}
msg.Append(',');
msg.AppendAddress(shared->address());
msg.Append(",%s", ComputeMarker(code));
- msg.Append('\n');
msg.WriteToLogFile();
}
msg.Append(":%d:%d\",", line, column);
msg.AppendAddress(shared->address());
msg.Append(",%s", ComputeMarker(code));
- msg.Append('\n');
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
AppendCodeCreateHeader(&msg, tag, code);
msg.Append("\"args_count: %d\"", args_count);
- msg.Append('\n');
msg.WriteToLogFile();
}
SmartArrayPointer<char> name =
shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
msg.Append("\"%s\",", name.get());
- msg.Append("\"%s\"\n", GetBailoutReason(shared->DisableOptimizationReason()));
+ msg.Append("\"%s\"", GetBailoutReason(shared->DisableOptimizationReason()));
msg.WriteToLogFile();
}
msg.Append('"');
msg.AppendDetailed(source, false);
msg.Append('"');
- msg.Append('\n');
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[CODE_DELETE_EVENT]);
msg.AppendAddress(from);
- msg.Append('\n');
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos);
msg.AppendDoubleQuotedString(code_name);
- msg.Append("\n");
msg.WriteToLogFile();
}
msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
msg.AppendAddress(addr);
msg.Append(",%d", pos);
- msg.Append('\n');
msg.WriteToLogFile();
}
msg.AppendAddress(from);
msg.Append(',');
msg.AppendAddress(to);
- msg.Append('\n');
msg.WriteToLogFile();
}
msg.Append("%d,%d,", sec, usec);
}
msg.Append("%.0f", base::OS::TimeCurrentMillis());
-
- msg.Append('\n');
msg.WriteToLogFile();
}
} else {
msg.AppendSymbolName(Symbol::cast(name));
}
- msg.Append('\n');
msg.WriteToLogFile();
}
Log::MessageBuilder msg(log_);
// Using non-relative system time in order to be able to synchronize with
// external memory profiling events (e.g. DOM memory size).
- msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f\n",
- space, kind, base::OS::TimeCurrentMillis());
+ msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f", space, kind,
+ base::OS::TimeCurrentMillis());
msg.WriteToLogFile();
}
void Logger::HeapSampleEndEvent(const char* space, const char* kind) {
if (!log_->IsEnabled() || !FLAG_log_gc) return;
Log::MessageBuilder msg(log_);
- msg.Append("heap-sample-end,\"%s\",\"%s\"\n", space, kind);
+ msg.Append("heap-sample-end,\"%s\",\"%s\"", space, kind);
msg.WriteToLogFile();
}
void Logger::HeapSampleItemEvent(const char* type, int number, int bytes) {
if (!log_->IsEnabled() || !FLAG_log_gc) return;
Log::MessageBuilder msg(log_);
- msg.Append("heap-sample-item,%s,%d,%d\n", type, number, bytes);
+ msg.Append("heap-sample-item,%s,%d,%d", type, number, bytes);
msg.WriteToLogFile();
}
void Logger::DebugTag(const char* call_site_tag) {
if (!log_->IsEnabled() || !FLAG_log) return;
Log::MessageBuilder msg(log_);
- msg.Append("debug-tag,%s\n", call_site_tag);
+ msg.Append("debug-tag,%s", call_site_tag);
msg.WriteToLogFile();
}
}
char* parameter_string = s.Finalize();
Log::MessageBuilder msg(log_);
- msg.Append("debug-queue-event,%s,%15.3f,%s\n",
- event_type,
- base::OS::TimeCurrentMillis(),
- parameter_string);
+ msg.Append("debug-queue-event,%s,%15.3f,%s", event_type,
+ base::OS::TimeCurrentMillis(), parameter_string);
DeleteArray(parameter_string);
msg.WriteToLogFile();
}
msg.Append(',');
msg.AppendAddress(sample->stack[i]);
}
- msg.Append('\n');
msg.WriteToLogFile();
}