2004-01-28 20:02:12 -05:00
|
|
|
/*
|
|
|
|
** Logging framework.
|
|
|
|
**
|
2018-10-12 06:28:09 -04:00
|
|
|
** Copyright (C) 2014 Michael Smith <msmith@icecast.org>,
|
|
|
|
** Ralph Giles <giles@xiph.org>,
|
|
|
|
** Ed "oddsock" Zaleski <oddsock@xiph.org>,
|
|
|
|
** Karl Heyes <karl@xiph.org>,
|
|
|
|
** Jack Moffitt <jack@icecast.org>,
|
|
|
|
** Thomas Ruecker <thomas@ruecker.fi>,
|
|
|
|
** Copyright (C) 2012-2018 Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>
|
2014-12-05 04:31:08 -05:00
|
|
|
**
|
|
|
|
** This library is free software; you can redistribute it and/or
|
|
|
|
** modify it under the terms of the GNU Library General Public
|
|
|
|
** License as published by the Free Software Foundation; either
|
|
|
|
** version 2 of the License, or (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This library is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
** Library General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU Library General Public
|
|
|
|
** License along with this library; if not, write to the
|
|
|
|
** Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
** Boston, MA 02110-1301, USA.
|
|
|
|
**
|
2004-01-28 20:02:12 -05:00
|
|
|
*/
|
|
|
|
|
2018-10-12 06:16:06 -04:00
|
|
|
#ifndef _LIBIGLOO__LOG_H_
|
|
|
|
#define _LIBIGLOO__LOG_H_
|
2001-09-09 22:24:39 -04:00
|
|
|
|
2002-01-29 04:20:28 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2001-09-09 22:24:39 -04:00
|
|
|
#define LOG_EINSANE -1
|
|
|
|
#define LOG_ENOMORELOGS -2
|
|
|
|
#define LOG_ECANTOPEN -3
|
|
|
|
#define LOG_ENOTOPEN -4
|
2001-10-20 12:47:01 -04:00
|
|
|
#define LOG_ENOTIMPL -5
|
2001-09-09 22:24:39 -04:00
|
|
|
|
2003-02-26 22:02:30 -05:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define IO_BUFFER_TYPE _IONBF
|
|
|
|
#else
|
|
|
|
#define IO_BUFFER_TYPE _IOLBF
|
|
|
|
#endif
|
2001-09-09 22:24:39 -04:00
|
|
|
|
2018-10-12 06:55:24 -04:00
|
|
|
void igloo_log_initialize(void);
|
|
|
|
int igloo_log_open_file(FILE *file);
|
|
|
|
int igloo_log_open(const char *filename);
|
|
|
|
int igloo_log_open_with_buffer(const char *filename, int size);
|
|
|
|
void igloo_log_set_level(int log_id, unsigned level);
|
|
|
|
void igloo_log_set_trigger(int id, unsigned trigger);
|
|
|
|
int igloo_log_set_filename(int id, const char *filename);
|
|
|
|
void igloo_log_set_lines_kept (int log_id, unsigned int count);
|
|
|
|
void igloo_log_contents (int log_id, char **_contents, unsigned int *_len);
|
|
|
|
int igloo_log_set_archive_timestamp(int id, int value);
|
|
|
|
void igloo_log_flush(int log_id);
|
|
|
|
void igloo_log_reopen(int log_id);
|
|
|
|
void igloo_log_close(int log_id);
|
|
|
|
void igloo_log_shutdown(void);
|
2001-09-09 22:24:39 -04:00
|
|
|
|
2018-10-12 06:55:24 -04:00
|
|
|
void igloo_log_write(int log_id, unsigned priority, const char *cat, const char *func,
|
2002-08-03 04:14:56 -04:00
|
|
|
const char *fmt, ...);
|
2018-10-12 06:55:24 -04:00
|
|
|
void igloo_log_write_direct(int log_id, const char *fmt, ...);
|
2001-09-09 22:24:39 -04:00
|
|
|
|
|
|
|
#endif /* __LOG_H__ */
|