133 {
134#if !defined(OS_FUCHSIA)
135 stream_ << std::endl;
136#endif
137 if (capture_next_log_stream_) {
138 *capture_next_log_stream_ << stream_.str();
139 capture_next_log_stream_ = nullptr;
140 } else {
141#if defined(FML_OS_ANDROID)
142 android_LogPriority priority =
143 (severity_ < 0) ? ANDROID_LOG_VERBOSE : ANDROID_LOG_UNKNOWN;
144 switch (severity_) {
147 priority = ANDROID_LOG_INFO;
148 break;
150 priority = ANDROID_LOG_WARN;
151 break;
153 priority = ANDROID_LOG_ERROR;
154 break;
156 priority = ANDROID_LOG_FATAL;
157 break;
158 }
159 __android_log_write(priority, "flutter", stream_.str().c_str());
160#elif defined(FML_OS_IOS)
161 syslog(LOG_ALERT, "%s", stream_.str().c_str());
162#elif defined(OS_FUCHSIA)
163 FuchsiaLogSeverity severity;
164 switch (severity_) {
167 severity = FUCHSIA_LOG_INFO;
168 break;
170 severity = FUCHSIA_LOG_WARNING;
171 break;
173 severity = FUCHSIA_LOG_ERROR;
174 break;
176 severity = FUCHSIA_LOG_FATAL;
177 break;
178 default:
179 if (severity_ < 0) {
180 severity = FUCHSIA_LOG_DEBUG;
181 } else {
182
183 severity = FUCHSIA_LOG_INFO;
184 }
185 break;
186 }
187 fuchsia_syslog::LogBuffer
buffer;
188 buffer.BeginRecord(severity, std::string_view(file_), line_,
189 std::string_view(stream_.str()), socket.borrow(), 0, pid,
190 tid);
191 if (!process_name.empty()) {
192 buffer.WriteKeyValue(
"tag", process_name);
193 }
195 for (auto& tag : *tags_ptr) {
196 buffer.WriteKeyValue(
"tag", tag);
197 }
198 }
200#else
201
202 fprintf(stderr, "%s", stream_.str().c_str());
203 fflush(stderr);
204#endif
205 }
206
209 }
210}
static LogState & Default()
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
constexpr LogSeverity kLogFatal
constexpr LogSeverity kLogImportant
constexpr LogSeverity kLogError
constexpr LogSeverity kLogWarning