diff --git a/examples/basic_logging.c b/examples/basic_logging.c index bd02950..0ad27a1 100644 --- a/examples/basic_logging.c +++ b/examples/basic_logging.c @@ -21,7 +21,9 @@ void log_handler(void * const userdata, const char * const area, const char * const msg) { - fprintf(stderr, "%s %s %s\n", area, xmpp_log_level_name[level], msg); + static const char * const log_level_name[4] = {"DEBUG", "INFO", "WARN", "ERROR"}; + + fprintf(stderr, "%s %s %s\n", area, log_level_name[level], msg); } void conn_handler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, diff --git a/src/ctx.c b/src/ctx.c index e98da55..4c05cb4 100644 --- a/src/ctx.c +++ b/src/ctx.c @@ -63,6 +63,8 @@ static xmpp_mem_t xmpp_default_mem = { realloc }; +static const char * const xmpp_log_level_name[4] = {"DEBUG", "INFO", "WARN", "ERROR"}; + void xmpp_default_logger(void * const userdata, const xmpp_log_level_t level, const char * const area, diff --git a/strophe.h b/strophe.h index 9b04ec5..f690b17 100644 --- a/strophe.h +++ b/strophe.h @@ -63,8 +63,6 @@ typedef enum { XMPP_LEVEL_ERROR } xmpp_log_level_t; -static const char * const xmpp_log_level_name[4] = {"DEBUG", "INFO", "WARN", "ERROR"}; - typedef enum { XMPP_UNKNOWN, XMPP_CLIENT,