2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public License
7 * version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 #define LOG_BUFFER_SIZE 256
24 * printf-style writing to the log file. A buffer of LOG_BUFFER_SIZE
25 * bytes is preallocated for the complete format message, longer
26 * messages will be truncated.
30 log_flag_replace_buffer=1,
31 log_flag_force_flush=2,
32 log_flag_keep_pointer=4,
33 log_flag_keep_buffer=8,
42 int log_get_attr(struct log *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
43 struct log *log_new(struct attr *parent, struct attr **attrs);
44 void log_set_header(struct log *this_, char *data, int len);
45 void log_set_trailer(struct log *this_, char *data, int len);
46 void log_write(struct log *this_, char *data, int len, enum log_flags flags);
47 void *log_get_buffer(struct log *this_, int *len);
48 void log_printf(struct log *this_, char *fmt, ...);
49 void log_destroy(struct log *this_);
50 /* end of prototypes */