Move the log_level_name[] definitions back to private status within the library.

Defining static data in the header causes warnings on Apple gcc, and in general
this should be the client's responsibility. The names are obvious from the
log_level enum, which is public, and it's only one line of boilerplate to
copy in implementing a custom logging function.
This commit is contained in:
Ralph Giles
2005-06-29 15:36:40 +00:00
parent 6a1b2cada9
commit 83b5721607
3 changed files with 5 additions and 3 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,