1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
2 
3    caja-debug-log.h: Ring buffer for logging debug messages
4 
5    Copyright (C) 2006 Novell, Inc.
6 
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2 of the
10    License, or (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 
17    You should have received a copy of the GNU General Public
18    License along with this program; if not, write to the
19    Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20    Boston, MA 02110-1301, USA.
21 
22    Author: Federico Mena-Quintero <federico@novell.com>
23 */
24 
25 #ifndef CAJA_DEBUG_LOG_H
26 #define CAJA_DEBUG_LOG_H
27 
28 #include <glib.h>
29 
30 #define CAJA_DEBUG_LOG_DOMAIN_USER "USER"   /* always enabled */
31 #define CAJA_DEBUG_LOG_DOMAIN_ASYNC "async"	 /* when asynchronous notifications come in */
32 #define CAJA_DEBUG_LOG_DOMAIN_GLOG "GLog"	 /* used for GLog messages; don't use it yourself */
33 
34 void caja_debug_log (gboolean is_milestone, const char *domain, const char *format, ...);
35 
36 void caja_debug_log_with_uri_list (gboolean is_milestone, const char *domain, const GList *uris,
37                                    const char *format, ...);
38 void caja_debug_log_with_file_list (gboolean is_milestone, const char *domain, GList *files,
39                                     const char *format, ...);
40 
41 void caja_debug_logv (gboolean is_milestone, const char *domain, const GList *uris, const char *format, va_list args);
42 
43 gboolean caja_debug_log_load_configuration (const char *filename, GError **error);
44 
45 void caja_debug_log_enable_domains (const char **domains, int n_domains);
46 void caja_debug_log_disable_domains (const char **domains, int n_domains);
47 
48 gboolean caja_debug_log_is_domain_enabled (const char *domain);
49 
50 gboolean caja_debug_log_dump (const char *filename, GError **error);
51 
52 void caja_debug_log_set_max_lines (int num_lines);
53 int caja_debug_log_get_max_lines (void);
54 
55 /* For testing only */
56 void caja_debug_log_clear (void);
57 
58 #endif /* CAJA_DEBUG_LOG_H */
59