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
LevelDescription
QL_VERBOSE.DISABLEDLogging entirely disabled
QL_VERBOSE.OFFWarnings, errors, and criticals only
QL_VERBOSE.DEFAULTInfo level (default)
QL_VERBOSE.DEBUGDebug level; increased verbosity
QL_VERBOSE.DISASMDisassembly for every instruction + debug
QL_VERBOSE.DUMPCPU 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()