Skip to content
Snippets Groups Projects
Commit 87ae4bf7 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Add --gdebug option

Sets the G_MESSAGES_DEBUG env var so GLib debug messages are printed
parent b060fab5
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import os
import time
import sys
from datetime import datetime
......@@ -140,6 +141,13 @@ def __init__(self):
GLib.OptionArg.NONE,
_('Open IPython shell'))
self.add_main_option(
'gdebug',
0,
GLib.OptionFlags.NONE,
GLib.OptionArg.NONE,
_('Sets an enviroment variable so GLib debug messages are printed'))
self.add_main_option(
'show-next-pending-event',
0,
......@@ -346,6 +354,9 @@ def _handle_local_options(self,
configpaths.init()
if options.contains('gdebug'):
os.environ['G_MESSAGES_DEBUG'] = 'all'
if app.get_debug_mode():
# Redirect has to happen before logging init
self._cleanup_debug_logs()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment