NNG_LOG(3)
πΈ NAME πΈ
nng_log β posting messages into your logs, no cap π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
void nng_log_err(const char *msgid, const char *msg, ...);
void nng_log_warn(const char *msgid, const char *msg, ...);
void nng_log_notice(const char *msgid, const char *msg, ...);
void nng_log_info(const char *msgid, const char *msg, ...);
void nng_log_debug(const char *msgid, const char *msg, ...);
void nng_log_auth(nng_log_level level, const char *msgid, const char *msg, ...);
π DESCRIPTION π
Okay so bestie, these functions are literally your lil messenger service π«Ά β you use them to post a message to system or application logs. That's the whole vibe.
The first five forms all post a message at the severity indicated by the function name, periodt. So like, nng_log_err is giving major red-flag energy, nng_log_debug is your chill lil whisper, you get it π
The msgid should be a short message identifier, and it should indicate the message in question. And guess what β a NULL value for msgid can be used as well. Iconic, flexible, we love that for you β¨
π message identifiers (the msgid situation)
Message identifiers can be used to assist in filtering logs. They should uniquely identify the nature of the problem, where possible, to assist in trouble-shooting. Keep them short too β eight characters or less is ideal, and more than sixteen is strongly discouraged. Not me begging you to keep your msgids cute and tiny π
β the formatting
The message is formatted as if by sprintf, using msg as the format, and the remaining arguments as arguments to the format. Classic. Standard. Slays. π
π nng_log_auth
The final function, nng_log_auth, is used for posting authentication related messages, which might be treated specially β such as by storing them in a separate secured log file π. It takes the severity as a level in level.
The severity can be one of the following values:
NNG_LOG_ERRNNG_LOG_WARNNNG_LOG_NOTICENNG_LOG_INFONNG_LOG_DEBUG
π where do the messages even go tho
The message itself is handled according to the logging facility set up with nng_log_set_logger.
β οΈ Heads up bestie: message delivery is best effort, and messages may be suppressed based on the priority set with nng_log_set_level. So like... don't be shocked if your lil message ghosted you π
π And this one is important: in order to get log messages, a suitable logger must be set usingnng_log_set_logger. The default logger,nng_null_logger, simply discards logged content. Yeah. It just throws your lil message into the void and walks away. Fr fr. Set a logger, or you're screaming into the abyss π³οΈβ¨
π SEE ALSO π
k bye ily, this page is brought to you by the NNG Reference Manual, dated 2026-06-30, and yes the page you're on rn is NNG_LOG(3) β stay logged, stay slaying ππ¦
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms