Debugger | Algorand Developer Portal

Debugger

The AlgoKit Python Utilities package provides a set of debugging tools that can be used to simulate and trace transactions on the Algorand blockchain. These tools and methods are optimized for developers who are building applications on Algorand and need to test and debug their smart contracts via AlgoKit AVM Debugger extension.

Configuration

The config.py file contains the UpdatableConfig class which manages and updates configuration settings for the AlgoKit project.

The configure method can be used to set these attributes.

To enable debug mode in your project you can configure it as follows:

from algokit_utils.config import config

config.configure(

debug=True,

project_root=Path("./my-project"),

trace_all=True,

trace_buffer_size_mb=512,

max_search_depth=15,

populate_app_call_resources=True,

)

AlgoKitLogger

The AlgoKitLogger is a custom logger that is used to log messages in the AlgoKit project. It is a subclass of the logging.Logger class and extends it to provide additional functionality.

Suppressing log messages per log call

To supress log messages for individual log calls you can pass 'suppress_log':True to the log call’s extra argument.

Suppressing log messages globally

To supress log messages globally you can configure the config object to use a custom logger that does not log anything.

config.configure(logger=AlgoKitLogger.get_null_logger())

Debugging Utilities

When debug mode is enabled, AlgoKit Utils will automatically:

The following methods are provided for manual debugging operations:

Trace filename format

The trace files are named in a specific format to provide useful information about the transactions they contain. The format is as follows:

${timestamp}_lr${last_round}_${transaction_types}.trace.avm.json

Where:

For example, a trace file might be named 20220301T123456Z_lr1000_2pay_1axfer.trace.avm.json, indicating that the trace file was created at 2022-03-01T12:34:56Z, the last round was 1000, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.