When you are programmning with ChatGPT, and you like logs, use this way...

Panther28

Elite Member
Executive VIP
Jr. VIP
Joined
May 2, 2010
Messages
10,006
Reaction score
16,139
When you want to go up a level, and use "Exceptional Comments"

tell chat gpt to make it so and do like this:

JavaScript:
function setupCustomOrderButton() {
    console.log(`[START] setupCustomOrderButton - Starting setup process for custom_order_button...`);

    console.log(`[ACTION] setupCustomOrderButton - Checking for existence of custom_order_button inside custom_order.`);
    if (!this.custom_order?.custom_order_button) {
        console.error(`[ERROR] setupCustomOrderButton - custom_order_button NOT detected inside custom_order! Check instance name.`);
        console.log(`[END] setupCustomOrderButton - Exiting setup process due to missing custom_order_button.`);
        return;
    }

    console.log(`[INFO] setupCustomOrderButton - custom_order_button detected successfully.`);
    console.log(`[ACTION] setupCustomOrderButton - Adding click event listener to custom_order_button.`);
    this.custom_order.custom_order_button.on("click", () => {
        console.log(`[ACTION] setupCustomOrderButton - custom_order_button clicked!`);

        console.log(`[ACTION] setupCustomOrderButton - Setting currentStage to 'custom_order'.`);
        currentStage = "custom_order"; // Set the current stage
        console.log(`[INFO] setupCustomOrderButton - Stage set to: ${currentStage}`);

        console.log(`[ACTION] setupCustomOrderButton - Calling setupInteractiveGraphics with parameters (1740, 200).`);
        setupInteractiveGraphics.call(this, 1740, 200); // Starting Y position and spacing
    });

    console.log(`[END] setupCustomOrderButton - Setup process for custom_order_button completed.`);
}

Not sure what else there is but info action start finish error, maybe loop?

The point is when you use this way, you can just feed your code log back into chatgpt and it'll save you a headache trying to remember where things go, and help being explicit to ai that the flow of the program is a certain way.

If you tried programming with chat gpt you'll know that it will happily give you missing codebases from what you just asked a moment ago, and got. So this will keep both you and the ai right.

Happy programming.
 
When you want to go up a level, and use "Exceptional Comments"

tell chat gpt to make it so and do like this:

JavaScript:
function setupCustomOrderButton() {
    console.log(`[START] setupCustomOrderButton - Starting setup process for custom_order_button...`);

    console.log(`[ACTION] setupCustomOrderButton - Checking for existence of custom_order_button inside custom_order.`);
    if (!this.custom_order?.custom_order_button) {
        console.error(`[ERROR] setupCustomOrderButton - custom_order_button NOT detected inside custom_order! Check instance name.`);
        console.log(`[END] setupCustomOrderButton - Exiting setup process due to missing custom_order_button.`);
        return;
    }

    console.log(`[INFO] setupCustomOrderButton - custom_order_button detected successfully.`);
    console.log(`[ACTION] setupCustomOrderButton - Adding click event listener to custom_order_button.`);
    this.custom_order.custom_order_button.on("click", () => {
        console.log(`[ACTION] setupCustomOrderButton - custom_order_button clicked!`);

        console.log(`[ACTION] setupCustomOrderButton - Setting currentStage to 'custom_order'.`);
        currentStage = "custom_order"; // Set the current stage
        console.log(`[INFO] setupCustomOrderButton - Stage set to: ${currentStage}`);

        console.log(`[ACTION] setupCustomOrderButton - Calling setupInteractiveGraphics with parameters (1740, 200).`);
        setupInteractiveGraphics.call(this, 1740, 200); // Starting Y position and spacing
    });

    console.log(`[END] setupCustomOrderButton - Setup process for custom_order_button completed.`);
}

Not sure what else there is but info action start finish error, maybe loop?

The point is when you use this way, you can just feed your code log back into chatgpt and it'll save you a headache trying to remember where things go, and help being explicit to ai that the flow of the program is a certain way.

If you tried programming with chat gpt you'll know that it will happily give you missing codebases from what you just asked a moment ago, and got. So this will keep both you and the ai right.

Happy programming.
This is some pretty nice information.
 
How i managed to work with chatgpt for 2 years, without doing this, is frightening, lol

here is an update I'm also starting to use. It features all the logs of whats going on in the function. So you can paste back into chatgpt, and get more accurate replies.

JavaScript:
function attachMenuRecordListener(mainMenuInstance) {
    console.group(`[FUNCTION: attachMenuRecordListener]`);
    console.log(`[INFO] Function Name: attachMenuRecordListener`);
    console.log(`[INFO] Parameters: mainMenuInstance`);
    console.log(`[INFO] Called Functions Summary:`);
    console.log(`  - mainMenuInstance.getChildByName("menu_record_button")`);
    console.log(`  - menuRecordButton.on("click", callback)`);
    console.log(`  - toggleMainMenu()`);
    console.log(`  - transitionToNextStageOrState(stage)`);
    console.log(`[INFO] Parameters Passed to Called Functions:`);
    console.log(`  - "menu_record_button" for mainMenuInstance.getChildByName`);
    console.log(`  - "click" for menuRecordButton.on`);
    console.log(`  - No parameters for toggleMainMenu()`);
    console.log(`  - window.currentStage or "main_meal" for transitionToNextStageOrState`);
    console.groupEnd();

Happy and faster programming.
 
Back
Top