[dart_runner] Initialize logging and tracing (flutter/engine#13829)

Remove !defined(FUCHSIA_SDK) bits to start using the SDK
apis to initialize logging and trace events for dart runners.
This commit is contained in:
Kaushik Iska
2019-11-13 10:02:09 -08:00
committed by GitHub
parent 311aa4808b
commit 24bf127ba8

View File

@@ -4,6 +4,7 @@
#include <lib/async-loop/cpp/loop.h>
#include <lib/async-loop/default.h>
#include <lib/syslog/global.h>
#include <lib/trace-provider/provider.h>
#include <lib/trace/event.h>
@@ -15,10 +16,6 @@
#include "runtime/dart/utils/tempfs.h"
#include "third_party/dart/runtime/include/dart_api.h"
#if !defined(FUCHSIA_SDK)
#include <lib/syslog/cpp/logger.h>
#endif // !defined(FUCHSIA_SDK)
#if !defined(DART_PRODUCT)
// Register native symbol information for the Dart VM's profiler.
static void RegisterProfilerSymbols(const char* symbols_path,
@@ -34,20 +31,17 @@ static void RegisterProfilerSymbols(const char* symbols_path,
#endif // !defined(DART_PRODUCT)
int main(int argc, const char** argv) {
fx_log_init();
async::Loop loop(&kAsyncLoopConfigAttachToCurrentThread);
#if !defined(FUCHSIA_SDK)
syslog::InitLogger();
std::unique_ptr<trace::TraceProviderWithFdio> provider;
{
TRACE_EVENT0("dart", "CreateTraceProvider");
TRACE_DURATION("dart", "CreateTraceProvider");
bool already_started;
// Use CreateSynchronously to prevent loss of early events.
trace::TraceProviderWithFdio::CreateSynchronously(
loop.dispatcher(), "dart_runner", &provider, &already_started);
}
#endif // !defined(FUCHSIA_SDK)
#if !defined(DART_PRODUCT)
#if defined(AOT_RUNTIME)