update debugfilter docs
parent
0858b95c40
commit
0f3811b933
@ -1,89 +1,72 @@
|
|||||||
debug
|
debug
|
||||||
=====
|
=====
|
||||||
Manager for DFHack runtime debug prints. Debug prints are grouped by plugin name,
|
|
||||||
category name and print level. Levels are ``trace``, ``debug``, ``info``,
|
Tags:
|
||||||
``warning`` and ``error``.
|
:dfhack-keybind:`debugfilter`
|
||||||
|
|
||||||
|
:index:`Configure verbosity of DFHack debug output.
|
||||||
|
<debugfilter; Configure verbosity of DFHack debug output.>` Debug output is
|
||||||
|
grouped by plugin name, category name, and verbosity level.
|
||||||
|
|
||||||
|
The verbosity levels are:
|
||||||
|
|
||||||
|
- ``Trace``
|
||||||
|
Possibly very noisy messages which can be printed many times per second.
|
||||||
|
- ``Debug``
|
||||||
|
Messages that happen often but they should happen only a couple of times per
|
||||||
|
second.
|
||||||
|
- ``Info``
|
||||||
|
Important state changes that happen rarely during normal execution.
|
||||||
|
- ``Warning``
|
||||||
|
Enabled by default. Shows warnings about unexpected events which code
|
||||||
|
managed to handle correctly.
|
||||||
|
- ``Error``
|
||||||
|
Enabled by default. Shows errors which code can't handle without user
|
||||||
|
intervention.
|
||||||
|
|
||||||
The runtime message printing is controlled using filters. Filters set the
|
The runtime message printing is controlled using filters. Filters set the
|
||||||
visible messages of all matching categories. Matching uses regular expression syntax,
|
visible messages of all matching categories. Matching uses regular expression
|
||||||
which allows listing multiple alternative matches or partial name matches.
|
syntax, which allows listing multiple alternative matches or partial name
|
||||||
This syntax is a C++ version of the ECMA-262 grammar (Javascript regular expressions).
|
matches. This syntax is a C++ version of the ECMA-262 grammar (Javascript
|
||||||
Details of differences can be found at
|
regular expressions). Details of differences can be found at
|
||||||
https://en.cppreference.com/w/cpp/regex/ecmascript
|
https://en.cppreference.com/w/cpp/regex/ecmascript
|
||||||
|
|
||||||
Persistent filters are stored in ``dfhack-config/runtime-debug.json``.
|
Persistent filters are stored in ``dfhack-config/runtime-debug.json``. Oldest
|
||||||
Oldest filters are applied first. That means a newer filter can override the
|
filters are applied first. That means a newer filter can override the older
|
||||||
older printing level selection.
|
printing level selection.
|
||||||
|
|
||||||
Usage: ``debugfilter [subcommand] [parameters...]``
|
Usage:
|
||||||
|
|
||||||
The following subcommands are supported:
|
- ``debugfilter category [<plugin regex>] [<category regex>]``
|
||||||
|
List available debug plugin and category names. If filters aren't givenm
|
||||||
help
|
then all plugins/categories are matched. This command is a good way to test
|
||||||
----
|
regex parameters before you pass them to ``set``.
|
||||||
Give overall help or a detailed help for a subcommand.
|
- ``debugfilter filter [<id>]``
|
||||||
|
List active and passive debug print level changes. The optional ``id``
|
||||||
Usage: ``debugfilter help [subcommand]``
|
parameter is the id listed as first column in the filter list. If ``id`` is
|
||||||
|
given, then the command shows extended information for the given filter
|
||||||
category
|
only.
|
||||||
--------
|
- ``debugfilter set [<level>] [<plugin regex>] [<category regex>]``
|
||||||
List available debug plugin and category names.
|
Create a new debug filter to set category verbosity levels. This filter
|
||||||
|
will not be saved when the DF process exists or the plugin is unloaded.
|
||||||
Usage: ``debugfilter category [plugin regex] [category regex]``
|
- ``debugfilter set persistent [<level>] [<plugin regex>] [<category regex>]``
|
||||||
|
Store the filter in the configuration file to until ``unset`` is used to
|
||||||
The list can be filtered using optional regex parameters. If filters aren't
|
remove it.
|
||||||
given then the it uses ``"."`` regex which matches any character. The regex
|
- ``debugfilter unset <id> [<id> ...]``
|
||||||
parameters are good way to test regex before passing them to ``set``.
|
Delete a space separated list of filters.
|
||||||
|
- ``debugfilter disable <id> [<id> ...]``
|
||||||
filter
|
Disable a space separated list of filters but keep it in the filter list.
|
||||||
------
|
- ``debugfilter enable <id> [<id> ...]``
|
||||||
List active and passive debug print level changes.
|
Enable a space sperate list of filters.
|
||||||
|
- ``debugfilter header [enable] | [disable] [<element> ...]``
|
||||||
Usage: ``debugfilter filter [id]``
|
Control which header metadata is shown along with each log message. Run it
|
||||||
|
without parameters to see the list of configurable elements. Include an
|
||||||
Optional ``id`` parameter is the id listed as first column in the filter list.
|
``enable`` or ``disable`` keyword to change whether specific elements are
|
||||||
If id is given then the command shows information for the given filter only in
|
shown.
|
||||||
multi line format that is better format if filter has long regex.
|
|
||||||
|
Examples:
|
||||||
set
|
|
||||||
---
|
- ``debugfilter set Warning core script``
|
||||||
Creates a new debug filter to set category printing levels.
|
Hide script execution log messages (e.g. "Loading script:
|
||||||
|
dfhack-config/dfhack.init"), which are normally output at Info verbosity
|
||||||
Usage: ``debugfilter set [level] [plugin regex] [category regex]``
|
in the "core" plugin with the "script" category.
|
||||||
|
|
||||||
Adds a filter that will be deleted when DF process exists or plugin is unloaded.
|
|
||||||
|
|
||||||
Usage: ``debugfilter set persistent [level] [plugin regex] [category regex]``
|
|
||||||
|
|
||||||
Stores the filter in the configuration file to until ``unset`` is used to remove
|
|
||||||
it.
|
|
||||||
|
|
||||||
Level is the minimum debug printing level to show in log.
|
|
||||||
|
|
||||||
* ``trace``: Possibly very noisy messages which can be printed many times per second
|
|
||||||
|
|
||||||
* ``debug``: Messages that happen often but they should happen only a couple of times per second
|
|
||||||
|
|
||||||
* ``info``: Important state changes that happen rarely during normal execution
|
|
||||||
|
|
||||||
* ``warning``: Enabled by default. Shows warnings about unexpected events which code managed to handle correctly.
|
|
||||||
|
|
||||||
* ``error``: Enabled by default. Shows errors which code can't handle without user intervention.
|
|
||||||
|
|
||||||
unset
|
|
||||||
-----
|
|
||||||
Delete a space separated list of filters
|
|
||||||
|
|
||||||
Usage: ``debugfilter unset [id...]``
|
|
||||||
|
|
||||||
disable
|
|
||||||
-------
|
|
||||||
Disable a space separated list of filters but keep it in the filter list
|
|
||||||
|
|
||||||
Usage: ``debugfilter disable [id...]``
|
|
||||||
|
|
||||||
enable
|
|
||||||
------
|
|
||||||
Enable a space sperate list of filters
|
|
||||||
|
|
||||||
Usage: ``debugfilter enable [id...]``
|
|
||||||
|
Loading…
Reference in New Issue