Bird
Raised Fist0
Agentic AIml~20 mins

Logging tool calls and results in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Logging Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this logging command?
Given the following command to log a tool call and its result, what will be the output in the log file?
Agentic AI
log_tool_call('deploy', {'version': '1.2.3'})
log_tool_result('deploy', 'success')
A[ERROR] Tool deploy called with args: {'version': '1.2.3'}\n[INFO] Tool deploy finished with result: success
B[INFO] Tool deploy called with args: version=1.2.3\n[INFO] Tool deploy finished with result: success
C[INFO] Tool deploy called with args: {'version': '1.2.3'}\n[INFO] Tool deploy finished with result: success
D[INFO] Tool deploy called with args: {'version': '1.2.3'}\n[ERROR] Tool deploy finished with result: failure
Attempts:
2 left
💡 Hint
Look carefully at the log levels and exact argument formatting.
Troubleshoot
intermediate
2:00remaining
Which option causes a logging failure?
Which of the following code snippets will cause a runtime error when logging tool calls and results?
A
log_tool_call('deploy', {'version': '2.0'})
log_tool_result('deploy')
B
log_tool_call('test', None)
log_tool_result('test', 'passed')
C
log_tool_call('build', {'target': 'release'})
log_tool_result('build', 'success')
D
log_tool_call('lint', {'files': ['a.py', 'b.py']})
log_tool_result('lint', 'completed')
Attempts:
2 left
💡 Hint
Check if all required arguments are provided to the logging functions.
Configuration
advanced
2:00remaining
Which logging configuration enables detailed tool call tracing?
You want to configure logging to capture detailed tool call arguments and results with timestamps. Which configuration snippet achieves this?
Alogging.basicConfig(level=logging.WARNING, format='%(asctime)s - %(message)s')
Blogging.basicConfig(level=logging.ERROR, format='%(message)s')
Clogging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s')
Dlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
Attempts:
2 left
💡 Hint
Detailed tracing needs info level and timestamps in the format.
🔀 Workflow
advanced
2:00remaining
What is the correct sequence to log a tool call and its result?
Arrange the steps in the correct order to properly log a tool call and its result.
A1,3,2,4
B2,1,3,4
C2,3,1,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Logging the call happens before the tool runs, logging the result after it finishes.
Best Practice
expert
3:00remaining
Which practice ensures reliable logging of tool calls and results in concurrent environments?
In a system where multiple tool calls happen concurrently, which practice best ensures logs are accurate and not mixed up?
AUse thread-safe logging libraries and include unique request IDs in each log entry
BWrite logs to a shared file without synchronization to improve speed
CDisable logging during concurrent tool calls to avoid conflicts
DLog only the start of tool calls and ignore results to reduce log volume
Attempts:
2 left
💡 Hint
Think about how to keep logs clear and traceable when many things happen at once.