Porytiles
Loading...
Searching...
No Matches
buffered_user_diagnostics.cpp
Go to the documentation of this file.
2
3#include <string>
4#include <vector>
5
8
9namespace porytiles2 {
10
11void BufferedUserDiagnostics::note(const std::string &tag, const std::vector<std::string> &lines) const
12{
13 notes_.push_back(lines);
14 note_tag_counts_[tag]++;
15}
16
17void BufferedUserDiagnostics::warn_note(const std::string &tag, const std::vector<std::string> &lines) const
18{
19 warn_notes_.push_back(lines);
20 warn_note_tag_counts_[tag]++;
21}
22
23void BufferedUserDiagnostics::warn(const std::string &tag, const std::vector<std::string> &lines) const
24{
25 warnings_.push_back(lines);
26 warning_tag_counts_[tag]++;
27}
28
29void BufferedUserDiagnostics::err(const std::string &tag, const std::vector<std::string> &lines) const
30{
31 errors_.push_back(lines);
32 error_tag_counts_[tag]++;
33}
34
36{
37 PlainTextFormatter formatter{};
38 fatal_proximates_.push_back(err.details(formatter));
39}
40
42{
43 PlainTextFormatter formatter{};
44 fatal_steps_.push_back(err.details(formatter));
45}
46
48{
49 PlainTextFormatter formatter{};
50 fatal_roots_.push_back(err.details(formatter));
51}
52
53} // namespace porytiles2
void warn(const std::string &tag, const std::vector< std::string > &lines) const override
Display a multi-line tagged warning message.
void emit_fatal_root(const Error &err) const override
Emit the root cause error in a fatal error chain.
void emit_fatal_proximate(const Error &err) const override
Emit the proximate (immediate) error in a fatal error chain.
void err(const std::string &tag, const std::vector< std::string > &lines) const override
Display a multi-line tagged error message.
void warn_note(const std::string &tag, const std::vector< std::string > &lines) const override
Display a multi-line tagged warning note message.
void note(const std::string &tag, const std::vector< std::string > &lines) const override
Display a multi-line tagged informational note message.
void emit_fatal_step(const Error &err) const override
Emit an intermediate step error in a fatal error chain.
Abstract interface for all error types used in ChainableResult error chains.
Definition error.hpp:26
TextFormatter implementation that strips all styling from text.