2004-01-29 01:02:12 +00:00
|
|
|
/*
|
|
|
|
** Logging framework.
|
|
|
|
**
|
|
|
|
** This program is distributed under the GNU General Public License, version 2.
|
|
|
|
** A copy of this license is included with this source.
|
|
|
|
*/
|
|
|
|
|
2001-09-10 02:24:39 +00:00
|
|
|
#ifndef __LOG_H__
|
|
|
|
#define __LOG_H__
|
|
|
|
|
2002-01-29 09:20:28 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2001-09-10 02:24:39 +00:00
|
|
|
#define LOG_EINSANE -1
|
|
|
|
#define LOG_ENOMORELOGS -2
|
|
|
|
#define LOG_ECANTOPEN -3
|
|
|
|
#define LOG_ENOTOPEN -4
|
2001-10-20 16:47:01 +00:00
|
|
|
#define LOG_ENOTIMPL -5
|
2001-09-10 02:24:39 +00:00
|
|
|
|
2003-02-27 03:02:30 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define IO_BUFFER_TYPE _IONBF
|
|
|
|
#else
|
|
|
|
#define IO_BUFFER_TYPE _IOLBF
|
|
|
|
#endif
|
2001-09-10 02:24:39 +00:00
|
|
|
|
2005-12-17 12:23:54 +00:00
|
|
|
void log_initialize(void);
|
2002-01-29 09:20:28 +00:00
|
|
|
int log_open_file(FILE *file);
|
2001-09-10 02:24:39 +00:00
|
|
|
int log_open(const char *filename);
|
|
|
|
int log_open_with_buffer(const char *filename, int size);
|
2003-07-09 02:45:22 +00:00
|
|
|
void log_set_level(int log_id, unsigned level);
|
|
|
|
void log_set_trigger(int id, unsigned trigger);
|
|
|
|
int log_set_filename(int id, const char *filename);
|
2006-03-27 02:26:06 +00:00
|
|
|
void log_set_lines_kept (int log_id, unsigned int count);
|
|
|
|
void log_contents (int log_id, char **_contents, unsigned int *_len);
|
2005-10-24 14:52:35 +00:00
|
|
|
int log_set_archive_timestamp(int id, int value);
|
2001-09-10 02:24:39 +00:00
|
|
|
void log_flush(int log_id);
|
|
|
|
void log_reopen(int log_id);
|
|
|
|
void log_close(int log_id);
|
2005-12-17 12:23:54 +00:00
|
|
|
void log_shutdown(void);
|
2001-09-10 02:24:39 +00:00
|
|
|
|
2003-07-09 02:45:22 +00:00
|
|
|
void log_write(int log_id, unsigned priority, const char *cat, const char *func,
|
2002-08-03 08:14:56 +00:00
|
|
|
const char *fmt, ...);
|
2013-01-02 14:44:43 +00:00
|
|
|
void log_write_direct(int log_id, const char *fmt, ...);
|
2001-09-10 02:24:39 +00:00
|
|
|
|
|
|
|
#endif /* __LOG_H__ */
|