Definition at line 86 of file progress_indicator.h.
#include <progress_indicator.h>
◆ json_logger_progress_indicator()
clanguml::common::generators::json_logger_progress_indicator::json_logger_progress_indicator |
( |
| ) |
|
|
default |
◆ ~json_logger_progress_indicator()
clanguml::common::generators::json_logger_progress_indicator::~json_logger_progress_indicator |
( |
| ) |
|
|
overridedefault |
◆ add_progress_bar()
void clanguml::common::generators::json_logger_progress_indicator::add_progress_bar |
( |
const std::string & |
name, |
|
|
size_t |
max, |
|
|
indicators::Color |
color |
|
) |
| |
|
overridevirtual |
Add a new progress bar to the indicator set
- Parameters
-
name | Name (prefix) of the progress bar |
max | Total number of steps in the progress bar |
color | Color of the progress bar |
Implements clanguml::common::generators::progress_indicator_base.
Definition at line 37 of file progress_indicator.cc.
39{
40 inja::json j;
41 j["diagram_name"] = name;
42 j["max"] = max;
43 j["progress"] = 0;
44 j["status"] = "started";
45
47
49
51
52 spdlog::get("json-progress-logger")
53 ->log(spdlog::level::info, "{}", j.dump());
54}
◆ complete()
void clanguml::common::generators::json_logger_progress_indicator::complete |
( |
const std::string & |
name | ) |
|
|
overridevirtual |
Set specified progress bar as complete.
- Parameters
-
name | Name of the progress bar |
Implements clanguml::common::generators::progress_indicator_base.
Definition at line 149 of file progress_indicator.cc.
150{
151 inja::json j;
152 j["diagram_name"] = name;
153
155
158 return;
159 }
160
162
163 p.progress = p.max;
164
165 j["progress"] = p.progress;
166 j["max"] = p.max;
167 j["status"] = "completed";
168
170
171 spdlog::get("json-progress-logger")
172 ->log(spdlog::level::info, "{}", j.dump());
173}
◆ fail()
void clanguml::common::generators::json_logger_progress_indicator::fail |
( |
const std::string & |
name | ) |
|
|
overridevirtual |
Set progress bar as failed.
- Parameters
-
name | Name of the progress bar |
Implements clanguml::common::generators::progress_indicator_base.
Definition at line 206 of file progress_indicator.cc.
207{
208 inja::json j;
209 j["diagram_name"] = name;
210
212
215 return;
216 }
218
219 j["progress"] = p.progress;
220 j["max"] = p.max;
221 j["status"] = "failed";
222
224
225 spdlog::get("json-progress-logger")
226 ->log(spdlog::level::err, "{}", j.dump());
227}
◆ increment()
void clanguml::common::generators::json_logger_progress_indicator::increment |
( |
const std::string & |
name | ) |
|
|
overridevirtual |
Increment specified progress bar.
- Parameters
-
name | Name of the progress bar |
Implements clanguml::common::generators::progress_indicator_base.
Definition at line 89 of file progress_indicator.cc.
90{
91 inja::json j;
92 j["diagram_name"] = name;
93
95
98 return;
99 }
100
102
103 j["progress"] = p.progress;
104 j["max"] = p.max;
105 j["status"] = "ongoing";
106
107 p.progress++;
108
110
111 spdlog::get("json-progress-logger")
112 ->log(spdlog::level::info, "{}", j.dump());
113}
◆ stop()
void clanguml::common::generators::json_logger_progress_indicator::stop |
( |
| ) |
|
|
inlineoverridevirtual |
The documentation for this class was generated from the following files: