Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
validation.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include <atomic>
8
9#include "flutter/fml/logging.h"
10
11namespace impeller {
12
13static std::atomic_int32_t sValidationLogsDisabledCount = 0;
14static std::atomic_int32_t sValidationLogsAreFatal = 0;
15
19
23
27
31
35
37
40 ImpellerValidationBreak(stream_.str().c_str());
41 }
42}
43
44std::ostream& ValidationLog::GetStream() {
45 return stream_;
46}
47
49 std::stringstream stream;
50#if FLUTTER_RELEASE
51 stream << "Impeller validation: " << message;
52#else
53 stream << "Break on '" << __FUNCTION__
54 << "' to inspect point of failure: " << message;
55#endif
57 FML_LOG(FATAL) << stream.str();
58 } else {
59 FML_LOG(ERROR) << stream.str();
60 }
61}
62
66
67} // namespace impeller
std::ostream & GetStream()
Definition validation.cc:44
#define FATAL(error)
#define FML_LOG(severity)
Definition logging.h:82
Win32Message message
bool ImpellerValidationErrorsAreFatal()
Definition validation.cc:63
static std::atomic_int32_t sValidationLogsAreFatal
Definition validation.cc:14
void ImpellerValidationErrorsSetFatal(bool fatal)
Definition validation.cc:16
void ImpellerValidationBreak(const char *message)
Definition validation.cc:48
static std::atomic_int32_t sValidationLogsDisabledCount
Definition validation.cc:13
#define ERROR(message)