1
/*********************************************************
2
* Copyright (C) 2011 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
25
* A collection of utility functions that depend only on glib.
27
* These functions are guaranteed to have no dependencies on bora/lib libraries
37
* @brief Description for a logger.
39
* Contains information about a logger. The properties here are aimed at
40
* helping the logging code using this library to construct and appropriate
41
* log message depending on the output being used.
43
* For example, some sinks (like syslog) already add a timestamp to every log
44
* message. So if the @a addsTimestamp field is TRUE, the logging code can
45
* choose to rely on that and not add a redundant timestamp field to the log
48
typedef struct GlibLogger {
49
gboolean shared; /**< Output is shared with other processes. */
50
gboolean addsTimestamp; /**< Output adds timestamp automatically. */
51
GLogFunc logfn; /**< The function that writes to the output. */
52
GDestroyNotify dtor; /**< Destructor. */
57
GlibUtils_CreateFileLogger(const char *path,
63
GlibUtils_CreateStdLogger(void);
68
GlibUtils_AttachConsole(void);
71
GlibUtils_CreateDebugLogger(void);
74
GlibUtils_CreateEventLogger(const wchar_t *source,
80
GlibUtils_CreateSysLogger(const char *domain,
81
const char *facility);
85
#endif /* _GLIBUTILS_H_ */