Print and Logging
Print and Logging
Logging
Uses Python’s logging module. Available wherever a Qiling instance exists.
1ql.log.info('Hello from Qiling Framework!')
2ql.log.debug('debug message')
3ql.log.warning('warning message')
4ql.log.exception('exception with traceback')
Verbosity Levels
Set at initialization or dynamically during emulation:
1from qiling.const import QL_VERBOSE
2
3ql = Qiling([r'/bin/ls'], r'examples/rootfs/x86_linux', verbose=QL_VERBOSE.DEBUG)
4
5# Or change dynamically:
6ql.verbose = QL_VERBOSE.DISASM
| Level | Description |
|---|---|
QL_VERBOSE.DISABLED | Logging entirely disabled |
QL_VERBOSE.OFF | Warnings, errors, and criticals only |
QL_VERBOSE.DEFAULT | Info level (default) |
QL_VERBOSE.DEBUG | Debug level; increased verbosity |
QL_VERBOSE.DISASM | Disassembly for every instruction + debug |
QL_VERBOSE.DUMP | CPU context + disassembly + debug |
Log Filtering
Filter log entries with a regex. Only matching entries are shown.
1from qiling import Qiling
2
3ql = Qiling([r'examples/rootfs/arm_linux/bin/arm_hello'], r'examples/rootfs/arm_linux')
4ql.filter = '^open' # show only entries starting with "open"
5ql.run()