Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back NNG logging #242

Merged
merged 22 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Announce NNG version in log.
gdamore authored and JaylinYu committed Aug 21, 2024

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
commit 7e7ff0d92c9ae067c24430c69ea67d46428c11ab
17 changes: 12 additions & 5 deletions src/core/init.c
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
//

#include "core/nng_impl.h"
#include "nng/nng.h"

#include <stdbool.h>
#include <stdio.h>
@@ -45,14 +46,21 @@ nni_init_helper(void)
nni_mqtt_tran_sys_init();

nni_inited = true;
nng_log_notice(
"NNG-INIT", "NNG library version %s initialized", nng_version());

return (0);
}

int
nni_init(void)
{
return (nni_plat_init(nni_init_helper));
int rv;
if ((rv = nni_plat_init(nni_init_helper)) != 0) {
nng_log_err("NNG-INIT",
"NNG library initialization failed: %s", nng_strerror(rv));
}
return (rv);
}

// accessing the list of parameters
@@ -61,7 +69,7 @@ typedef struct nni_init_param {
nng_init_parameter param;
uint64_t value;
#ifdef NNG_TEST_LIB
uint64_t effective;
uint64_t effective;
#endif
} nni_init_param;

@@ -115,7 +123,7 @@ nni_init_set_effective(nng_init_parameter p, uint64_t value)
}
}
if ((item = NNI_ALLOC_STRUCT(item)) != NULL) {
item->param = p;
item->param = p;
item->effective = value;
nni_list_append(&nni_init_params, item);
}
@@ -135,11 +143,10 @@ nni_init_get_effective(nng_init_parameter p)
return (item->effective);
}
}
return ((uint64_t)-1);
return ((uint64_t) -1);
}
#endif


static void
nni_init_params_fini(void)
{