2.23.92
[evolution.git] / e-util / e-logger.h
blobf7dfd8017ed62bc4b4a13b83e423e00f4b03e62b
1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2 of the License, or (at your option) version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 * Authors:
17 * Srinivasa Ragavan <sragavan@gnome.org>
19 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
23 #ifndef __E_LOGGER_H__
24 #define __E_LOGGER_H__
26 #include <glib-object.h>
28 /* Standard GObject macros */
29 #define E_TYPE_LOGGER \
30 (e_logger_get_type ())
31 #define E_LOGGER(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST \
33 ((obj), E_TYPE_LOGGER, ELogger))
34 #define E_LOGGER_CLASS(cls) \
35 (G_TYPE_CHECK_CLASS_CAST \
36 ((cls), E_TYPE_LOGGER, ELoggerClass))
37 #define E_IS_LOGGER(obj) \
38 (G_TYPE_CHECK_INSTANCE_TYPE \
39 ((obj), E_TYPE_LOGGER))
40 #define E_IS_LOGGER_CLASS(cls) \
41 (G_TYPE_CHECK_CLASS_TYPE \
42 ((cls), E_TYPE_LOGGER))
43 #define E_LOGGER_GET_CLASS(obj) \
44 (G_TYPE_INSTANCE_GET_CLASS \
45 ((obj), E_TYPE_LOGGER, ELoggerClass))
47 G_BEGIN_DECLS
49 typedef struct _ELogger ELogger;
50 typedef struct _ELoggerClass ELoggerClass;
51 typedef struct _ELoggerPrivate ELoggerPrivate;
53 typedef void (*ELogFunction) (gchar *line, gpointer data);
55 enum e_log_level_t {
56 E_LOG_ERROR,
57 E_LOG_WARNINGS,
58 E_LOG_DEBUG
61 /* The object */
62 struct _ELogger {
63 GObject parent;
65 struct _ELoggerPrivate *priv;
68 struct _ELoggerClass {
69 GObjectClass popup_class;
72 GType e_logger_get_type (void);
73 ELogger * e_logger_create (gchar *component);
74 const gchar * e_logger_get_component (ELogger *logger);
75 void e_logger_log (ELogger *logger,
76 gint level,
77 gchar *primary,
78 gchar *secondary);
79 void e_logger_get_logs (ELogger *logger,
80 ELogFunction func,
81 gpointer data);
83 G_END_DECLS
85 #endif /* __E_LOGGER_H__ */