Skip to content
Snippets Groups Projects
Commit b344d3c9 authored by Adam Wujek's avatar Adam Wujek :speech_balloon:
Browse files

userspace/snmpd: add helper macros for verbose messages


Signed-off-by: default avatarAdam Wujek <adam.wujek@cern.ch>
parent f9332f2d
Branches
Tags
No related merge requests found
......@@ -52,4 +52,25 @@ struct pickinfo {
.len = sizeof(((struct _struct *)0)->_field), \
}
/*
* Print a message about an object
*
* Valid example2:
* strcpy(slog_obj_name, "my_obj");
* SLOG(SL_BUG);
* prints:
* SNMP: BUG my_obj
*/
#define SLOG(_log_type) \
do { \
snmp_log(LOG_ERR, "SNMP: " _log_type " %s\n", slog_obj_name); \
} while (0)
/* String definitions for functions SLOG* */
#define SL_ER "Error"
#define SL_W "Warning"
#define SL_NA "Warning NA"
#define SL_BUG "BUG"
#endif /* WRS_SNMP_H */
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment