Merge commit 'e7755f5d9f8a5e995b83a239c05016cf1d58abba'

This commit is contained in:
Florian Bruhin 2017-04-06 07:10:22 +02:00
commit d9d0fbb6ae
4 changed files with 26 additions and 6 deletions

View File

@ -24,6 +24,8 @@ Added
- New `ui -> keyhint-delay` setting to configure the delay until
the keyhint overlay pops up.
- New `-s` option for `:open` to force a HTTPS scheme.
- `:debug-log-filter` now accepts `none` as an argument to clear any log
filters.
Changed
~~~~~~~
@ -52,6 +54,7 @@ Fixed
- Crash when pressing ctrl-c while a config error is shown
- Crash when the key config isn't writable
- Crash when unbinding an unbound key in the key config
- Crash when using `:debug-log-filter` when `--filter` wasn't given on startup.
- Various rare crashes
v0.10.1

View File

@ -293,15 +293,24 @@ def debug_log_filter(filters: str):
"""Change the log filter for console logging.
Args:
filters: A comma separated list of logger names.
filters: A comma separated list of logger names. Can also be "none" to
clear any existing filters.
"""
if set(filters.split(',')).issubset(log.LOGGER_NAMES):
log.console_filter.names = filters.split(',')
else:
if log.console_filter is None:
raise cmdexc.CommandError("No log.console_filter. Not attached "
"to a console?")
if filters.strip().lower() == 'none':
log.console_filter.names = None
return
if not set(filters.split(',')).issubset(log.LOGGER_NAMES):
raise cmdexc.CommandError("filters: Invalid value {} - expected one "
"of: {}".format(filters,
', '.join(log.LOGGER_NAMES)))
log.console_filter.names = filters.split(',')
@cmdutils.register()
@cmdutils.argument('current_win_id', win_id=True)

View File

@ -182,9 +182,10 @@ def init_log(args):
root = logging.getLogger()
global console_filter
if console is not None:
console_filter = LogFilter(None)
if args.logfilter is not None:
console_filter = LogFilter(args.logfilter.split(','))
console.addFilter(console_filter)
console_filter.names = args.logfilter.split(',')
console.addFilter(console_filter)
root.addHandler(console)
if ram is not None:
root.addHandler(ram)

View File

@ -164,3 +164,10 @@ Feature: Miscellaneous utility commands exposed to the user.
Scenario: Using debug-log-filter with invalid filter
When I run :debug-log-filter blah
Then the error "filters: Invalid value blah - expected one of: statusbar, *" should be shown
Scenario: Using debug-log-filter
When I run :debug-log-filter commands,ipc,webview
And I run :enter-mode insert
And I run :debug-log-filter none
And I run :leave-mode
Then "Entering mode KeyMode.insert *" should not be logged