@@ -33,31 +33,30 @@ ScopedValidationFatal::~ScopedValidationFatal() {
3333 sValidationLogsAreFatal --;
3434}
3535
36- ValidationLog::ValidationLog () = default ;
36+ ValidationLog::ValidationLog (const char * file, int line)
37+ : file_(file), line_(line) {}
3738
3839ValidationLog::~ValidationLog () {
3940 if (sValidationLogsDisabledCount <= 0 ) {
40- ImpellerValidationBreak (stream_.str ().c_str ());
41+ ImpellerValidationBreak (stream_.str ().c_str (), file_, line_ );
4142 }
4243}
4344
4445std::ostream& ValidationLog::GetStream () {
4546 return stream_;
4647}
4748
48- void ImpellerValidationBreak (const char * message) {
49- std::stringstream stream;
49+ void ImpellerValidationBreak (const char * message, const char * file, int line) {
50+ const auto severity =
51+ ImpellerValidationErrorsAreFatal () ? fml::LOG_FATAL : fml::LOG_ERROR;
52+ auto fml_log = fml::LogMessage{severity, file, line, nullptr };
53+ fml_log.stream () <<
5054#if FLUTTER_RELEASE
51- stream << " Impeller validation: " << message;
52- #else
53- stream << " Break on '" << __FUNCTION__
54- << " ' to inspect point of failure: " << message;
55- #endif
56- if (sValidationLogsAreFatal > 0 ) {
57- FML_LOG (FATAL) << stream.str ();
58- } else {
59- FML_LOG (ERROR) << stream.str ();
60- }
55+ " Impeller validation: " << message;
56+ #else // FLUTTER_RELEASE
57+ " Break on '" << __FUNCTION__
58+ << " ' to inspect point of failure: " << message;
59+ #endif // FLUTTER_RELEASE
6160}
6261
6362bool ImpellerValidationErrorsAreFatal () {
0 commit comments