ChatGPT Prompt Template
Problem Source Analysis and Logging Strategy
Helps in identifying the most likely sources of a problem in software and devising a logging strategy to validate assumptions before implementing fixes.
ChatGPTCategory: Programming & Code
Prompt Template
You are an experienced software engineer tasked with diagnosing a problem in a software system. Your goal is to reflect on 5-7 different possible sources of the issue, distill those down to 1-2 most likely sources, and then implement logging to validate your assumptions before moving on to the actual code fix. Follow these steps to approach the problem effectively: Identify 5-7 potential sources of the problem based on system behavior and symptoms. Analyze and distill these potential sources to identify the 1-2 most likely causes. For each likely cause, add logging statements in strategic locations to gather data and validate your assumptions. Your response should be structured as follows: <source_analysis> [List and briefly describe possible sources of the problem] </source_analysis> <likely_sources> [Identify and explain the 1-2 most likely sources of the problem] </likely_sources> <logging_strategy> [Describe where and what kind of logs you would add to validate your assumptions] </logging_strategy> Make sure your explanations are clear and concise, and that your logging strategy is actionable and specific.
Tags:#debugging#problem analysis#logging#software development#source identification
<source_analysis>
Incorrect data processing logic leading to unexpected results.
Database connectivity issues causing intermittent failures.
External API rate limiting resulting in request throttling.
Concurrency problems leading to race conditions.
Misconfigured environment variables affecting system behavior.
Outdated dependencies causing compatibility issues.
Insufficient resource allocation leading to performance bottlenecks. </source_analysis>
<likely_sources>
Incorrect data processing logic: Given the symptoms, it's likely that a bug in the logic is causing unexpected results during data handling.
Database connectivity issues: Frequent intermittent failures suggest there might be problems with database connections or configurations. </likely_sources>
<logging_strategy>
For data processing logic:
Add logs at key points within the processing functions to capture input data, intermediate states, and output results.
Example: logger.info("Processing input: %s", inputData)
For database connectivity:
Add connection attempt logs to track success and failure rates.
Log detailed error messages upon connection failures to identify root causes.
Example: logger.error("Database connection failed: %s", error.message) </logging_strategy>Save & Organize on iOS
Use this prompt on your iPhone & iPad
PromptKit keeps your 300+ favorite prompts ready at your fingertips with 1-click clipboard actions and offline private iCloud sync.
More Programming & Code Prompts
View all 6ChatGPT#swift
Correcting Errors in SwiftUI
Fix your code.
View Prompt
ChatGPT#swift
Writing code for new features in SwiftUI
Get the code you need.
View Prompt
ChatGPT#typescript
TypeScript Fibonacci Function
A prompt to generate an efficient TypeScript function for calculating the Fibonacci sequence with detailed comments.
View Prompt
ChatGPT#application development
Step-by-Step Application Development
Step-by-step guidance for developing small applications like CRON jobs, tailored for high school students.
View Prompt