1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00
profanity/log.c

29 lines
639 B
C
Raw Normal View History

2012-02-05 15:10:10 +00:00
#include <stdio.h>
#include <strophe/strophe.h>
#include "log.h"
extern FILE *logp;
void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level,
const char * const area, const char * const msg);
static const xmpp_log_t file_log = { &xmpp_file_logger, XMPP_LEVEL_DEBUG };
xmpp_log_t *xmpp_get_file_logger()
{
return (xmpp_log_t*) &file_log;
}
void xmpp_file_logger(void * const userdata, const xmpp_log_level_t level,
const char * const area, const char * const msg)
2012-02-05 15:22:02 +00:00
{
logmsg(area, msg);
}
void logmsg(const char * const area, const char * const msg)
2012-02-05 15:10:10 +00:00
{
fprintf(logp, "%s DEBUG %s\n", area, msg);
}