From e074192cc47e7f0b62efd63d9b697bea0d01d9f9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 19 Aug 2016 15:27:56 +0200 Subject: [PATCH] Update docs --- CHANGELOG.asciidoc | 2 ++ README.asciidoc | 2 +- doc/help/commands.asciidoc | 20 ++++++++++++++++++++ qutebrowser/misc/utilcmds.py | 5 +++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index a11969268..d16e7570a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -39,6 +39,8 @@ Added to focus the previous/next category in the completion (bound to `` and `` by default). - New `:click-element` command to fake a click on a element. +- New `:debug-log-filter` command to change console log filtering on-the-fly. +- New `:debug-log-level` command to change the console loglevel on-the-fly. Changed ~~~~~~~ diff --git a/README.asciidoc b/README.asciidoc index ebcc58316..6af28d775 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -199,6 +199,7 @@ Contributors, sorted by the number of commits in descending order: * Brian Jackson * sbinix * neeasade +* knaggita * jnphilipp * Tobias Patzl * Stefan Tatschner @@ -224,7 +225,6 @@ Contributors, sorted by the number of commits in descending order: * zwarag * xd1le * oniondreams -* knaggita * issue * haxwithaxe * evan diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index e73d6cf80..eb76fa84f 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -1449,6 +1449,8 @@ These commands are mainly intended for debugging. They are hidden if qutebrowser |<>|Crash for debugging purposes. |<>|Dump the current page's content to a file. |<>|Change the number of log lines to be stored in RAM. +|<>|Change the log filter for console logging. +|<>|Change the log level for console logging. |<>|Evaluate a python string and display the results as a web page. |<>|Put data into the fake clipboard and enable logging, used for tests. |<>|Trace executed code via hunter. @@ -1500,6 +1502,24 @@ Change the number of log lines to be stored in RAM. ==== positional arguments * +'capacity'+: Number of lines for the log. +[[debug-log-filter]] +=== debug-log-filter +Syntax: +:debug-log-filter 'filters'+ + +Change the log filter for console logging. + +==== positional arguments +* +'filters'+: A comma separated list of logger names. + +[[debug-log-level]] +=== debug-log-level +Syntax: +:debug-log-level 'level'+ + +Change the log level for console logging. + +==== positional arguments +* +'level'+: The log level to set. + [[debug-pyeval]] === debug-pyeval Syntax: +:debug-pyeval [*--quiet*] 's'+ diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 20fce5e47..4d9ebb4a3 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -22,6 +22,7 @@ import functools import types import traceback +import logging try: import hunter @@ -257,7 +258,7 @@ def debug_log_level(level: str): """Change the log level for console logging. Args: - level: log level for console log. + level: The log level to set. """ log.console_handler.setLevel(log.LOG_LEVELS[level.upper()]) @@ -267,7 +268,7 @@ def debug_log_filter(filters: str): """Change the log filter for console logging. Args: - filters: log filters for console log. + filters: A comma separated list of logger names. """ if set(filters.split(',')).issubset(log.LOGGER_NAMES): log.console_filter.names = filters.split(',')