diff --git a/src/common/config.py b/src/common/config.py index 67e130fcd..dbbac1e43 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -35,7 +35,7 @@ class Config: __options = { # name: [ type, value ] - 'verbose': [ opt_bool, True ], + 'verbose': [ opt_bool, False ], 'delauth': [ opt_bool, True ], 'delroster': [ opt_bool, True ], 'alwaysauth': [ opt_bool, False ], diff --git a/src/common/connection.py b/src/common/connection.py index 2208dd78f..cada7dec0 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -534,7 +534,7 @@ class Connection: 'proxypass') else: proxy = None - if gajim.config.get('verbose'): + if gajim.verbose: con = common.xmpp.Client(hostname) else: con = common.xmpp.Client(hostname, debug = []) diff --git a/src/common/gajim.py b/src/common/gajim.py index ceee77eab..f65986083 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -24,6 +24,7 @@ import common.logger version = '0.7.1' config = common.config.Config() connections = {} +verbose = config.get('verbose') h = logging.StreamHandler() f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S') diff --git a/src/gajim.py b/src/gajim.py index 166562684..9ae343397 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -49,17 +49,20 @@ from common import optparser profile = '' try: - opts, args = getopt.getopt(sys.argv[1:], 'hp:', [ 'help', 'profile=' ]) + opts, args = getopt.getopt(sys.argv[1:], 'hvp:', [ 'help', 'verbose', + 'profile=']) except getopt.error, msg: - print msg - print 'for help use --help' - sys.exit(2) + print msg + print 'for help use --help' + sys.exit(2) for o, a in opts: - if o in ('-h', '--help'): - print 'gajim [--help] [--profile name]' - sys.exit(0) - elif o in ('-p', '--profile'): # gajim --profile name - profile = a + if o in ('-h', '--help'): + print 'gajim [--help] [--profile name]' + sys.exit(0) + elif o in ('-v', '--verbose'): + gajim.verbose = True + elif o in ('-p', '--profile'): # gajim --profile name + profile = a config_filename = os.path.expanduser('~/.gajim/config') @@ -72,7 +75,7 @@ if os.name == 'nt': config_filename = 'config' if profile: - config_filename += '.%s' % profile + config_filename += '.%s' % profile parser = optparser.OptionsParser(config_filename) @@ -706,7 +709,7 @@ class Interface: } parser.read() - if gajim.config.get('verbose'): + if gajim.verbose: gajim.log.setLevel(gajim.logging.DEBUG) else: gajim.log.setLevel(None)