14DEFINE_FLAG(
bool, force_log_flush,
false,
"Always flush log messages.");
21 force_log_flush_at_size,
23 "Flush log messages when buffer exceeds given size (disabled when 0).");
28 "Log isolates whose name include the filter. "
29 "Default: service isolate log messages are suppressed "
30 "(specify 'vm-service' to log them).");
33 redirect_isolate_log_to,
35 "Log isolate messages into the given file.");
41 static LogFile log_file;
45 static void Print(
const char*
data) {
51 :
handle_(Dart::file_open_callback()(FLAG_redirect_isolate_log_to,
61 if (printer_ ==
nullptr) {
62 if (FLAG_redirect_isolate_log_to ==
nullptr) {
65 printer_ = &LogFile::Print;
77 if (thread ==
nullptr) {
79 ASSERT(os_thread !=
nullptr);
80 return os_thread->
log();
83 if ((isolate_group !=
nullptr) &&
84 Log::ShouldLogForIsolateGroup(isolate_group)) {
86 ASSERT(os_thread !=
nullptr);
87 return os_thread->
log();
110 va_list measure_args;
111 va_copy(measure_args,
args);
118 va_copy(print_args,
args);
124 for (intptr_t
i = 0;
i <
len;
i++) {
145 const char* str = &buffer_[
cursor];
162bool Log::ShouldLogForIsolateGroup(
const IsolateGroup* isolate_group) {
163 if (FLAG_isolate_log_filter ==
nullptr) {
175 if (strstr(
name, FLAG_isolate_log_filter) ==
nullptr) {
187void Log::TerminateString() {
194void Log::EnableManualFlush() {
201void Log::DisableManualFlush(
const intptr_t cursor) {
207 ASSERT(manual_flush_ >= 0);
208 if (manual_flush_ == 0) {
213bool Log::ShouldFlush()
const {
214#ifdef DART_TARGET_OS_ANDROID
217 if (*(buffer_.
end() - 1) ==
'\n') {
221 return ((manual_flush_ == 0) || FLAG_force_log_flush ||
222 ((FLAG_force_log_flush_at_size > 0) &&
223 (
cursor() > FLAG_force_log_flush_at_size)));
226void LogBlock::Initialize() {
227 log_->EnableManualFlush();
231 log_->DisableManualFlush(cursor_);
void TruncateTo(intptr_t length)
static Dart_FileWriteCallback file_write_callback()
static IsolateGroup * vm_isolate_group()
static Dart_FileCloseCallback file_close_callback()
static bool IsSystemIsolateGroup(const IsolateGroup *group)
IsolateGroupSource * source() const
void Print(const char *format,...) PRINTF_ATTRIBUTE(2
Log(LogPrinter printer=nullptr)
void Flush(const intptr_t cursor=0)
void void VPrint(const char *format, va_list args)
static OSThread * Current()
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
OSThread * os_thread() const
static Thread * Current()
IsolateGroup * isolate_group() const
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
void * malloc(size_t size)
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
static int8_t data[kExtLength]
void(* LogPrinter)(const char *data)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
void Log(const char *format,...)