diff --git a/qutebrowser/misc/sessions.py b/qutebrowser/misc/sessions.py index bfd73ef32..fcd82cda1 100644 --- a/qutebrowser/misc/sessions.py +++ b/qutebrowser/misc/sessions.py @@ -519,7 +519,9 @@ class SessionManager(QObject): raise cmdexc.CommandError("Error while saving session: {}" .format(e)) else: - if not quiet: + if quiet: + log.sessions.debug("Saved session {}.".format(name)) + else: message.info("Saved session {}.".format(name)) @cmdutils.register(instance='session-manager') diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 7f5b4e2a6..5b97ba2a4 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -439,14 +439,21 @@ def expect_message(quteproc, server, category, message): @bdd.then(bdd.parsers.re(r'(?Pregex )?"(?P[^"]+)" should ' - r'be logged')) -def should_be_logged(quteproc, server, is_regex, pattern): + r'be logged( with level (?P.*))?')) +def should_be_logged(quteproc, server, is_regex, pattern, loglevel): """Expect the given pattern on regex in the log.""" if is_regex: pattern = re.compile(pattern) else: pattern = pattern.replace('(port)', str(server.port)) - line = quteproc.wait_for(message=pattern) + + args = { + 'message': pattern, + } + if loglevel: + args['loglevel'] = getattr(logging, loglevel.upper()) + + line = quteproc.wait_for(**args) line.expected = True diff --git a/tests/end2end/features/sessions.feature b/tests/end2end/features/sessions.feature index 5ec6e168a..50054c665 100644 --- a/tests/end2end/features/sessions.feature +++ b/tests/end2end/features/sessions.feature @@ -279,7 +279,7 @@ Feature: Saving and loading sessions Scenario: Saving session with --quiet When I run :session-save --quiet quiet_session - Then "Saved session quiet_session." should not be logged + Then "Saved session quiet_session." should be logged with level debug And the session quiet_session should exist Scenario: Saving session with --only-active-window