@@ -39,13 +39,15 @@ CubeFactoryImpl::CubeFactoryImpl(const std::string &service_name)
3939std::shared_ptr<CubeIface> CubeFactoryImpl::create_cube (
4040 const nlohmann::json &conf, const std::vector<std::string> &ingress_code,
4141 const std::vector<std::string> &egress_code, const log_msg_cb &log_msg,
42- const packet_in_cb &cb) {
42+ const set_log_level_cb &log_level_cb, const packet_in_cb &cb) {
4343 auto name = conf.at (" name" ).get <std::string>();
4444 auto type = string_to_cube_type (conf.at (" type" ).get <std::string>());
4545 auto level = stringLogLevel (conf.at (" loglevel" ).get <std::string>());
4646
4747 auto cube =
4848 create_cube (name, ingress_code, egress_code, log_msg, type, cb, level);
49+ auto base = std::dynamic_pointer_cast<BaseCube>(cube);
50+ base->set_log_level_cb (log_level_cb);
4951 return std::move (cube);
5052}
5153
@@ -96,13 +98,16 @@ std::shared_ptr<CubeIface> CubeFactoryImpl::create_cube(
9698std::shared_ptr<TransparentCubeIface> CubeFactoryImpl::create_transparent_cube (
9799 const nlohmann::json &conf, const std::vector<std::string> &ingress_code,
98100 const std::vector<std::string> &egress_code, const log_msg_cb &log_msg,
99- const packet_in_cb &cb, const attach_cb &attach) {
101+ const set_log_level_cb &log_level_cb, const packet_in_cb &cb,
102+ const attach_cb &attach) {
100103 auto name = conf.at (" name" ).get <std::string>();
101104 auto type = string_to_cube_type (conf.at (" type" ).get <std::string>());
102105 auto level = stringLogLevel (conf.at (" loglevel" ).get <std::string>());
103106
104107 auto cube = create_transparent_cube (name, ingress_code, egress_code, log_msg,
105108 type, cb, attach, level);
109+ auto base = std::dynamic_pointer_cast<BaseCube>(cube);
110+ base->set_log_level_cb (log_level_cb);
106111 return std::move (cube);
107112}
108113
0 commit comments