/*
 * loglib.h
 *
 * A non-intrusive minimal log framework.
 *
 * History:
 *      27/01/2014 Creation
 *      14/03/2014 Add log_setlogfile(), log_closelogfile.
 *
 * Author: Dario Rodriguez dario@softhome.net
 * This file is licensed under the terms of the GNU LGPL v2+
 */

#ifndef LOGLIB_H
#define LOGLIB_H

#ifndef __GNUC__
void log_write(char *type, char *format, ...);
#else
void log_write(char *type, char *format, ...) __attribute__ ((format (printf, 2, 3)));
#endif

char *log_hexdumpstr(char *data, long datasize);

void log_setlogfile(char *filename);
void log_closelogfile(void);
void log_setwritefunc(void (*newwritefunc)(int fd, char *buf, long bufsize, void *usrptr),void *usrptr);

#endif