|
32 | 32 |
|
33 | 33 | #include "apps/cu/cu_appconfig_cli11_schema.h" |
34 | 34 | #include "apps/cu/cu_worker_manager.h" |
| 35 | +#include "apps/services/console_helper.h" |
35 | 36 | #include "apps/services/metrics_log_helper.h" |
36 | 37 | #include "apps/units/cu_cp/cu_cp_builder.h" |
37 | 38 | #include "apps/units/cu_cp/cu_cp_logger_registrator.h" |
@@ -327,8 +328,15 @@ int main(int argc, char** argv) |
327 | 328 | // create CU-CP. |
328 | 329 | std::unique_ptr<srsran::srs_cu_cp::cu_cp> cu_cp_obj = build_cu_cp(cu_cp_config, cu_cp_dependencies); |
329 | 330 |
|
| 331 | + // TODO: Remove JSON sink and refactor console_helper to not require it upon construction |
| 332 | + // Set up the JSON log channel used by metrics. |
| 333 | + srslog::sink& json_sink = srslog::fetch_udp_sink("127.0.9.9", 61234, srslog::create_json_formatter()); |
| 334 | + srslog::log_channel& json_channel = srslog::fetch_log_channel("JSON_channel", json_sink, {}); |
| 335 | + json_channel.set_enabled(false); |
| 336 | + |
330 | 337 | // Create console helper object for commands and metrics printing. |
331 | | - // TODO console helper |
| 338 | + console_helper console(*epoll_broker, json_channel, cu_cp_obj->get_command_handler()); |
| 339 | + console.on_app_starting(); |
332 | 340 |
|
333 | 341 | // Create metrics log helper. |
334 | 342 | metrics_log_helper metrics_logger(srslog::fetch_basic_logger("METRICS")); |
@@ -374,14 +382,14 @@ int main(int argc, char** argv) |
374 | 382 | dlt_pcaps.push_back(std::move(e2ap_p)); |
375 | 383 |
|
376 | 384 | // Start processing. |
377 | | - // TODO console.on_app_running() |
| 385 | + console.on_app_running(); |
378 | 386 |
|
379 | 387 | while (is_running) { |
380 | 388 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
381 | 389 | } |
382 | 390 |
|
383 | 391 | // Console helper print stop |
384 | | - // TODO |
| 392 | + console.on_app_stopping(); |
385 | 393 |
|
386 | 394 | // Stop CU-UP activity. |
387 | 395 | cu_up_obj->stop(); |
|
0 commit comments