Skip to content

Safer copy logging POC #1473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 30, 2025
Merged

Safer copy logging POC #1473

merged 5 commits into from
Apr 30, 2025

Conversation

camden11
Copy link
Contributor

@camden11 camden11 commented Apr 29, 2025

Description and Context

This creates a new typed uiLogger that will help prevent lang errors. The uiLogger is meant to be used when logging anything from the new lang objects. It only accepts strings, so it'll catch accidental undefined and uncalled functions. This also updates all files that use the new lang objects to use uiLogger. It's already caught a few errors!

Who to Notify

@brandenrodgers @kemmerle @joe-yeager

Copy link
Contributor

@kemmerle kemmerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camden11, looked this over, and I like the changes! I'm good if you're ready to implement this. Perhaps it would be easier to break it down into separate PRs?

@camden11 camden11 requested a review from kemmerle April 30, 2025 15:57
`${statusStrings.SUBTASK_FAIL(
failedSubtasks.length === 1
? getSubtaskName(failedSubtasks[0])
: failedSubtasks.length + ' components',
displayId
)}\n`
);
logger.log('See below for a summary of errors.');
uiLogger.log('See below for a summary of errors.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to the lang file?

@@ -61,7 +61,7 @@ export async function getProjectConfig(
projectConfig,
};
} catch (e) {
logger.error('Could not read from project config');
uiLogger.error('Could not read from project config');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to lang file?

brandenrodgers
brandenrodgers previously approved these changes Apr 30, 2025
Copy link
Contributor

@brandenrodgers brandenrodgers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌 I bet we could use AI to fix the rest once Joe merges the PR to swap lang patterns

@camden11 camden11 merged commit e13504f into main Apr 30, 2025
1 check passed
@camden11 camden11 deleted the safe-copy-logging branch April 30, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants