2006-09-27 14:14:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 Martin Willi
|
|
|
|
* Hochschule fuer Technik Rapperswil
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License
|
|
|
|
* for more details.
|
2008-03-13 14:14:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup file_logger file_logger
|
|
|
|
* @{ @ingroup listeners
|
2006-09-27 14:14:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FILE_LOGGER_H_
|
|
|
|
#define FILE_LOGGER_H_
|
|
|
|
|
2009-07-08 07:00:02 +00:00
|
|
|
#include <bus/listeners/listener.h>
|
2006-09-27 14:14:44 +00:00
|
|
|
|
2009-07-08 07:00:02 +00:00
|
|
|
typedef struct file_logger_t file_logger_t;
|
2006-10-30 14:07:05 +00:00
|
|
|
|
2006-09-27 14:14:44 +00:00
|
|
|
/**
|
2008-10-14 08:52:13 +00:00
|
|
|
* Logger to files which implements listener_t.
|
2006-09-27 14:14:44 +00:00
|
|
|
*/
|
|
|
|
struct file_logger_t {
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2006-09-27 14:14:44 +00:00
|
|
|
/**
|
2008-10-14 08:52:13 +00:00
|
|
|
* Implements the listener_t interface.
|
2006-09-27 14:14:44 +00:00
|
|
|
*/
|
2008-10-14 08:52:13 +00:00
|
|
|
listener_t listener;
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2006-09-27 14:14:44 +00:00
|
|
|
/**
|
2008-10-14 08:52:13 +00:00
|
|
|
* Set the loglevel for a debug group.
|
2006-09-27 14:14:44 +00:00
|
|
|
*
|
2008-10-14 08:52:13 +00:00
|
|
|
* @param group debug group to set
|
2006-10-18 11:46:13 +00:00
|
|
|
* @param level max level to log (0..4)
|
2006-09-27 14:14:44 +00:00
|
|
|
*/
|
2008-10-14 08:52:13 +00:00
|
|
|
void (*set_level) (file_logger_t *this, debug_t group, level_t level);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2006-09-27 14:14:44 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Destroys a file_logger_t object.
|
2006-09-27 14:14:44 +00:00
|
|
|
*/
|
|
|
|
void (*destroy) (file_logger_t *this);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Constructor to create a file_logger_t object.
|
2006-09-27 14:14:44 +00:00
|
|
|
*
|
|
|
|
* @param out FILE to write to
|
|
|
|
* @return file_logger_t object
|
|
|
|
*/
|
|
|
|
file_logger_t *file_logger_create(FILE *out);
|
|
|
|
|
2009-03-24 17:43:01 +00:00
|
|
|
#endif /** FILE_LOGGER_H_ @}*/
|