diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-04-21 12:23:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-21 12:23:07 -0700 |
| commit | 56507ab5c4db009be5251bde832f594fe5ed3d5e (patch) | |
| tree | c70e7d669c3548a5c58ab27c0fc6118a96580863 /src/core/log.c | |
| parent | 3593eba5272bf627b99a2521b3f025141a49bcad (diff) | |
| download | nng-56507ab5c4db009be5251bde832f594fe5ed3d5e.tar.gz nng-56507ab5c4db009be5251bde832f594fe5ed3d5e.tar.bz2 nng-56507ab5c4db009be5251bde832f594fe5ed3d5e.zip | |
Logging improvements (#1816)
* Add nng_str_sockaddr to get string representation of socket address.
* Added nng_log_get_level() is meant to allow users to obtain the
current level and avoid some possibly expensive operations just
to collect debugging information when debugging is not in effect.
We use a custom logger for NUTS, and this fits within the NUTS
test framework well, so that if -v is supplied we get more content.
All tests now get this by default.
Diffstat (limited to 'src/core/log.c')
| -rw-r--r-- | src/core/log.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/log.c b/src/core/log.c index cef3169c..e415e159 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -37,6 +37,12 @@ nng_log_set_level(nng_log_level level) log_level = level; } +nng_log_level +nng_log_get_level(void) +{ + return (log_level); +} + void nng_log_set_logger(nng_logger logger) { @@ -54,7 +60,6 @@ nng_null_logger(nng_log_level level, nng_log_facility facility, NNI_ARG_UNUSED(facility); NNI_ARG_UNUSED(msgid); NNI_ARG_UNUSED(msg); - return; } void |
