grim/guifications3

moved guifications-gtk to cmake
cmake
2010-12-13, Gary Kramlich
36e02fafe588
moved guifications-gtk to cmake
/*
* Guifications - The end-all, be-all notification framework
* Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GF_LOG_H
#define GF_LOG_H
#include <stdarg.h>
#include <glib.h>
#include <gflib/gf_enum.h>
/**
* GfLogLevel:
* @GF_LOG_LEVEL_UNKNOWN: Unknown log level
* @GF_LOG_LEVEL_VERBOSE: Log everything
* @GF_LOG_LEVEL_INFO: Log info and up
* @GF_LOG_LEVEL_EVENT: Log events and up
* @GF_LOG_LEVEL_WARNING: Log warnings and up
* @GF_LOG_LEVEL_CRITICAL: Only log critical messages
* @GF_LOG_LEVELS: The number of log levels
*
* The different levels of logging.
*
* Log levels stack. What I mean is, verbose will show you everything, but
* event will only show you event, warning, and critical messages.
*/
typedef enum {
GF_LOG_LEVEL_UNKNOWN = -1, /*< skip >*/
GF_LOG_LEVEL_VERBOSE = 0, /*< nick=Verbose >*/
GF_LOG_LEVEL_INFO, /*< nick=Info >*/
GF_LOG_LEVEL_EVENT, /*< nick=Event >*/
GF_LOG_LEVEL_WARNING, /*< nick=Warning >*/
GF_LOG_LEVEL_CRITICAL, /*< nick=Critical >*/
GF_LOG_LEVELS /*< skip >*/
} GfLogLevel;
#include <gflib/gf_logger.h>
#define gf_log_set_g_log_handler(domain) \
(g_log_set_handler((domain), G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL \
| G_LOG_FLAG_RECURSION, gf_log_g_log_handler, NULL))
G_BEGIN_DECLS
void gf_log_add_g_log_handlers(void);
void gf_log_set_logger(GfLogger *new_logger);
GfLogger *gf_log_get_logger(void);
void gf_log_set_timestamp_format(const gchar *format);
const gchar *gf_log_get_timestamp_format(void);
void gf_log_toggle_timestamps(void);
gboolean gf_log_show_timestamps(void);
void gf_log_set_level(GfLogLevel level);
GfLogLevel gf_log_get_level(void);
void gf_log(GfLogLevel level, const gchar *category, const gchar *format, va_list args);
void gf_logv(GfLogLevel level, const gchar *category, const gchar *format, ...);
void gf_log_critical(const gchar *category, const gchar *format, ...);
void gf_log_warning(const gchar *category, const gchar *format, ...);
void gf_log_event(const gchar *category, const gchar *format, ...);
void gf_log_info(const gchar *category, const gchar *format, ...);
void gf_log_verbose(const gchar *category, const gchar *format, ...);
void gf_log_g_log_handler(const gchar *domain, GLogLevelFlags flags, const gchar *message, gpointer data);
#define gf_log_level_from_string(str) \
gf_enum_from_string(GF_TYPE_LOG_LEVEL, (str))
#define gf_log_level_to_string(level, i18n) \
gf_enum_to_string(GF_TYPE_LOG_LEVEL, (level), (i18n))
G_END_DECLS
#endif /* GF_LOG_H */