From a9e47c8ccb2eefbc707ee5b13dffef29cf8bdb5d Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 2 Aug 2019 09:54:34 +0100 Subject: nslog: Add nslog_short_level_name() for use in renderers Signed-off-by: Daniel Silverstone --- include/nslog/nslog.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/nslog/nslog.h') diff --git a/include/nslog/nslog.h b/include/nslog/nslog.h index 9113527..d63ed48 100644 --- a/include/nslog/nslog.h +++ b/include/nslog/nslog.h @@ -48,6 +48,17 @@ typedef enum { */ const char *nslog_level_name(nslog_level level); +/** + * Convert a logging level to a short string. + * + * The returned string is owned by the nslog library (static) and should + * not be freed. It will be exactly four characters wide and suitable for + * logging to a file neatly. + * + * \param level The level for which you want the 'short' name. + */ +const char *nslog_short_level_name(nslog_level level); + #define NSLOG_LEVEL_DD NSLOG_LEVEL_DEEPDEBUG #define NSLOG_LEVEL_DBG NSLOG_LEVEL_DEBUG #define NSLOG_LEVEL_CHAT NSLOG_LEVEL_VERBOSE -- cgit v1.2.3