try again
[claws.git] / src / common / log.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef LOG_H
21 #define LOG_H
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28
29 #define LOG_APPEND_TEXT_HOOKLIST "log_append_text"
30 #define LOG_TIME_LEN 11
31
32 typedef enum
33 {
34         LOG_NORMAL,
35         LOG_MSG,
36         LOG_WARN,
37         LOG_ERROR
38 } LogType;
39
40 typedef struct _LogText LogText;
41
42 struct _LogText
43 {
44         gchar           *text;
45         LogType          type;  
46 };
47
48 /* logging */
49 void set_log_file       (const gchar *filename);
50 void close_log_file     (void);
51 void log_verbosity_set  (gboolean verbose);
52 void log_print          (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
53 void log_message        (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
54 void log_warning        (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
55 void log_error          (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
56
57 #endif /* LOG_H */