113 {
114#if !defined(OS_FUCHSIA)
115 stream_ << std::endl;
116#endif
117 if (capture_next_log_stream_) {
118 *capture_next_log_stream_ << stream_.str();
119 capture_next_log_stream_ = nullptr;
120 } else {
121#if defined(FML_OS_ANDROID)
122 android_LogPriority priority =
123 (severity_ < 0) ? ANDROID_LOG_VERBOSE : ANDROID_LOG_UNKNOWN;
124 switch (severity_) {
127 priority = ANDROID_LOG_INFO;
128 break;
130 priority = ANDROID_LOG_WARN;
131 break;
133 priority = ANDROID_LOG_ERROR;
134 break;
136 priority = ANDROID_LOG_FATAL;
137 break;
138 }
139 __android_log_write(priority, "flutter", stream_.str().c_str());
140#elif defined(FML_OS_IOS)
141 syslog(LOG_ALERT, "%s", stream_.str().c_str());
142#elif defined(OS_FUCHSIA)
143 FuchsiaLogSeverity severity;
144 switch (severity_) {
147 severity = FUCHSIA_LOG_INFO;
148 break;
150 severity = FUCHSIA_LOG_WARNING;
151 break;
153 severity = FUCHSIA_LOG_ERROR;
154 break;
156 severity = FUCHSIA_LOG_FATAL;
157 break;
158 default:
159 if (severity_ < 0) {
160 severity = FUCHSIA_LOG_DEBUG;
161 } else {
162
163 severity = FUCHSIA_LOG_INFO;
164 }
165 break;
166 }
167 fuchsia_logging::LogBuffer
buffer =
168 fuchsia_logging::LogBufferBuilder(severity)
169 .WithFile(file_, line_)
170 .WithMsg(stream_.str())
171 .Build();
172 const std::string* process_name = GetProcessName();
173 if (process_name) {
174 buffer.WriteKeyValue(
"tag", *process_name);
175 }
176 [[maybe_unused]] zx::result result =
177 fuchsia_logging::FlushToGlobalLogger(buffer);
178#else
179
180 fprintf(stderr, "%s", stream_.str().c_str());
181 fflush(stderr);
182#endif
183 }
184
187 }
188}
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
constexpr LogSeverity kLogFatal
constexpr LogSeverity kLogImportant
constexpr LogSeverity kLogError
constexpr LogSeverity kLogWarning