forked from acouzens/open5gs
[NF] Move ogs_log_config_domain() location (#3210)
When we run the test, for example, ./tests/registration/registration simple-init, wee get an INFO message like the one below. ``` 05/17 14:24:03.933: [sbi] INFO: NF EndPoint(addr) setup [127.0.0.200:7777] (../lib/sbi/context.c:474) ``` When we run the code in Open5GS, the log level initially defaults to INFO. However, for test code, we change the log level to ERROR by automatically inserting the -e error option into argv. The reason for this is to prevent WARNING and INFO messages from appearing when the test code is run. However, the log level to ERROR is changed at the bottom of the initialize routine, which caused the above message to be printed during testing. To prevent this from being printed, I modified the code to change that log level to ERROR a little earlier.
This commit is contained in:
parent
95de14c72b
commit
80ab4c4a1b
|
@ -38,6 +38,10 @@ int amf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_AMF);
|
||||
amf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -50,10 +54,6 @@ int amf_initialize(void)
|
|||
rv = amf_context_nf_info();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
ogs_metrics_context_open(ogs_metrics_self());
|
||||
|
||||
rv = amf_sbi_open();
|
||||
|
|
|
@ -34,16 +34,16 @@ int ausf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_AUSF);
|
||||
ausf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ausf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ausf_sbi_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -36,16 +36,16 @@ int bsf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_BSF);
|
||||
bsf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = bsf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = bsf_sbi_open();
|
||||
if (rv != 0) return OGS_ERROR;
|
||||
|
||||
|
|
|
@ -41,16 +41,16 @@ int hss_initialize(void)
|
|||
hss_context_init();
|
||||
hss_event_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_metrics_context_parse_config(APP_NAME);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = hss_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
ogs_metrics_context_open(ogs_metrics_self());
|
||||
|
||||
rv = ogs_dbi_init(ogs_app()->db_uri);
|
||||
|
|
|
@ -52,6 +52,10 @@ int mme_initialize(void)
|
|||
rv = ogs_gtp_xact_init();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_gtp_context_parse_config(APP_NAME, "sgwc");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -61,10 +65,6 @@ int mme_initialize(void)
|
|||
rv = mme_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
ogs_metrics_context_open(ogs_metrics_self());
|
||||
|
||||
rv = mme_fd_init();
|
||||
|
|
|
@ -34,16 +34,16 @@ int nrf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_NRF);
|
||||
nrf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, NULL, NULL);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = nrf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = nrf_sbi_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -34,16 +34,16 @@ int nssf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_NSSF);
|
||||
nssf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = nssf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = nssf_sbi_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -37,6 +37,10 @@ int pcf_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_PCF);
|
||||
pcf_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -46,10 +50,6 @@ int pcf_initialize(void)
|
|||
rv = pcf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
ogs_metrics_context_open(ogs_metrics_self());
|
||||
|
||||
if (ogs_app()->db_uri) {
|
||||
|
|
|
@ -32,13 +32,13 @@ int pcrf_initialize(void)
|
|||
|
||||
pcrf_context_init();
|
||||
|
||||
rv = pcrf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = pcrf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
if (ogs_app()->db_uri) {
|
||||
rv = ogs_dbi_init(ogs_app()->db_uri);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
|
|
@ -36,16 +36,16 @@ int scp_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_SCP);
|
||||
scp_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "next_scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = scp_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = scp_sbi_open();
|
||||
if (rv != 0) return OGS_ERROR;
|
||||
|
||||
|
|
|
@ -36,16 +36,16 @@ int sepp_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_SEPP);
|
||||
sepp_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = sepp_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = sepp_sbi_open();
|
||||
if (rv != 0) return OGS_ERROR;
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@ int sgwc_initialize(void)
|
|||
rv = ogs_pfcp_xact_init();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_gtp_context_parse_config(APP_NAME, "sgwu");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -56,10 +60,6 @@ int sgwc_initialize(void)
|
|||
rv = sgwc_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = sgwc_gtp_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@ int sgwu_initialize(void)
|
|||
rv = ogs_pfcp_xact_init();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_gtp_context_parse_config(APP_NAME, "sgwc");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -53,10 +57,6 @@ int sgwu_initialize(void)
|
|||
rv = sgwu_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = sgwu_pfcp_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -51,6 +51,10 @@ int smf_initialize(void)
|
|||
rv = ogs_pfcp_xact_init();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_gtp_context_parse_config(APP_NAME, "upf");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -66,10 +70,6 @@ int smf_initialize(void)
|
|||
rv = smf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_pfcp_ue_pool_generate();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -34,16 +34,16 @@ int udm_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_UDM);
|
||||
udm_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = udm_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = udm_sbi_open();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -34,16 +34,16 @@ int udr_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_UDR);
|
||||
udr_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = udr_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_dbi_init(ogs_app()->db_uri);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@ int upf_initialize(void)
|
|||
rv = ogs_pfcp_xact_init();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_gtp_context_parse_config(APP_NAME, "smf");
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
@ -59,10 +63,6 @@ int upf_initialize(void)
|
|||
rv = upf_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_pfcp_ue_pool_generate();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
|
|
|
@ -37,6 +37,10 @@ int af_initialize(void)
|
|||
ogs_sbi_context_init(OpenAPI_nf_type_AF);
|
||||
af_context_init();
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
no_scp = ogs_global_conf()->parameter.no_scp;
|
||||
no_nrf = ogs_global_conf()->parameter.no_nrf;
|
||||
|
||||
|
@ -52,10 +56,6 @@ int af_initialize(void)
|
|||
rv = af_context_parse_config();
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = ogs_log_config_domain(
|
||||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
rv = af_sbi_open();
|
||||
if (rv != 0) return OGS_ERROR;
|
||||
|
||||
|
|
Loading…
Reference in New Issue