Flutter Engine
The Flutter Engine
validation.h
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
5#ifndef FLUTTER_IMPELLER_BASE_VALIDATION_H_
6#define FLUTTER_IMPELLER_BASE_VALIDATION_H_
7
8#include <sstream>
9
10namespace impeller {
11
13 public:
15
17
18 std::ostream& GetStream();
19
20 private:
21 std::ostringstream stream_;
22
23 ValidationLog(const ValidationLog&) = delete;
24
25 ValidationLog(ValidationLog&&) = delete;
26
27 ValidationLog& operator=(const ValidationLog&) = delete;
28
29 ValidationLog& operator=(ValidationLog&&) = delete;
30};
31
32void ImpellerValidationBreak(const char* message);
33
35
37
40
42
44
46};
47
50
52
54
56};
57
58} // namespace impeller
59
60//------------------------------------------------------------------------------
61/// Get a stream to the log Impeller uses for all validation errors. The
62/// behavior of these logs is as follows:
63///
64/// * Validation error are completely ignored in the Flutter release
65/// runtime-mode.
66/// * In non-release runtime-modes, validation logs are redirected to the
67/// Flutter `INFO` log. These logs typically show up when verbose logging is
68/// enabled.
69/// * If `ImpellerValidationErrorsSetFatal` is set to `true`, validation logs
70/// are fatal. The runtime-mode restriction still applies. This usually
71/// happens in test environments.
72///
73#define VALIDATION_LOG ::impeller::ValidationLog{}.GetStream()
74
75#endif // FLUTTER_IMPELLER_BASE_VALIDATION_H_
std::ostream & GetStream()
Definition: validation.cc:44
Win32Message message
bool ImpellerValidationErrorsAreFatal()
Definition: validation.cc:63
void ImpellerValidationErrorsSetFatal(bool fatal)
Definition: validation.cc:16
void ImpellerValidationBreak(const char *message)
Definition: validation.cc:48
ScopedValidationDisable(const ScopedValidationDisable &)=delete
ScopedValidationDisable & operator=(const ScopedValidationDisable &)=delete
ScopedValidationFatal(const ScopedValidationFatal &)=delete
ScopedValidationFatal & operator=(const ScopedValidationFatal &)=delete