LLDB Commands for manipulating formatters logging facility.
This repository is meant to be a submodule of lldb-bundle, look there for installation instructions.
You also have an option to clone this repository and add the following line
into your ~/.lldbinit
file:
command script import <path-to-repository>/lldb_fmtlog
LLDB custom type formatters normally use logging, as demonstrated in the following example:
logger = lldb.formatters.Logger.Logger()
logger.write('something interesting')
By default, such logging messages are discarded.
If you are either developing an LLDB formatter for a type, or analyzing a behavior of an existing formatter, you may find it helpful to quickly enable logging output with a provided command.
help fmtlog
Display a list of subcommands.
fmtlog enable [-h] [-l <level>] [-o <file>]
Enable formatters logging at the specified level
, and write logging messages
to the specified file
.
Possible level
values are:
fast
: use buffered logging.auto-flush
: use unbuffered logging; slow but more reliable.caller-info
: use unbuffered logging, and output a name of a caller function.
fmtlog disable [-h]
Disable formatters logging.
fmtlog state [-h]
Display the state of the logging facility.
Feel free to file an issue, or send a pull request.
Before making your changes, you need to establish a development environment. As this repository is meant to be a submodule of lldb-bundle, look there for creating the Python virtual environment suitable for developing with LLDB.
Once you activated the virtual environment, run:
make init
to install the required development tools.
Use your editor or IDE to make your changes. Add relevant tests. To prepare for a submission, run:
make format
make lint
make test
Fix lint issues and test failures.
Repeat until everything is OK, then open a pull request.
Thanks!