diff options
author | Garrett Regier <alias301@gmail.com> | 2010-06-28 10:01:50 -0700 |
---|---|---|
committer | Steve Frécinaux <code@istique.net> | 2010-07-02 00:53:37 +0200 |
commit | 48c847c31fa5931668f30502ac8434cb14bd3aad (patch) | |
tree | 33fac08fff30872933ad7fbd2394a7322ccc2c4d /libpeas/peas-debug.c | |
parent | 7ebe7b8540f7d44825eee828bc5fc080babd6faf (diff) | |
download | libpeas-48c847c31fa5931668f30502ac8434cb14bd3aad.tar.gz |
Show debugging log messages only when PEAS_DEBUG is set
https://bugzilla.gnome.org/show_bug.cgi?id=622997
Diffstat (limited to 'libpeas/peas-debug.c')
-rw-r--r-- | libpeas/peas-debug.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libpeas/peas-debug.c b/libpeas/peas-debug.c new file mode 100644 index 0000000..c94d672 --- /dev/null +++ b/libpeas/peas-debug.c @@ -0,0 +1,47 @@ +/* + * peas-debug.c + * This file is part of libpeas + * + * Copyright (C) 2010 - Garrett Regier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "libpeas/peas-debug.h" + + +static void +debug_log_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) +{ +} + +void +peas_debug_init (void) +{ + if (g_getenv ("PEAS_DEBUG") == NULL) + { + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_DEBUG, + debug_log_handler, + NULL); + } +} |