Skip to content
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

Improve bootstrap logging for help with iframe debugging #4020

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

Nokel81
Copy link
Collaborator

@Nokel81 Nokel81 commented Oct 12, 2021

Signed-off-by: Sebastian Malton sebastian@malton.name

This should help with issues like #4018

@Nokel81 Nokel81 added the chore label Oct 12, 2021
@Nokel81 Nokel81 requested a review from a team as a code owner October 12, 2021 19:34
@Nokel81 Nokel81 requested review from nevalla and jim-docker and removed request for a team October 12, 2021 19:34
@@ -43,6 +43,8 @@ export abstract class BaseStore<T> extends Singleton {
protected storeConfig?: Config<T>;
protected syncDisposers: Disposer[] = [];

readonly displayName: string = this.constructor.name;
Copy link
Contributor

@ixrock ixrock Oct 14, 2021

Choose a reason for hiding this comment

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

Remember info for class name would be useless/muggled when app is built with webpack's --production=true && optimization.minimized = true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I know, which is why for all of our built-in T extends BaseStore I override this. I would have wanted to make it abstract but that would have been a breaking change.

@Nokel81 Nokel81 requested a review from ixrock October 14, 2021 12:47
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch from d4c2afe to 82f95f0 Compare October 22, 2021 13:30
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch from 82f95f0 to a0dcf34 Compare October 28, 2021 11:31
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch 2 times, most recently from 384c464 to f1793a2 Compare November 2, 2021 20:12
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch from f1793a2 to d6fb3fa Compare November 3, 2021 13:54
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2021

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch from d6fb3fa to 3da2dfb Compare November 10, 2021 21:39
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Signed-off-by: Sebastian Malton <sebastian@malton.name>
@Nokel81 Nokel81 force-pushed the improve-bootstrap-loggin branch from 3da2dfb to 24d1295 Compare November 12, 2021 14:32
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@@ -66,13 +72,13 @@ export abstract class BaseStore<T> extends Singleton {
const res: any = this.fromStore(this.storeConfig.store);

if (res instanceof Promise || (typeof res === "object" && res && typeof res.then === "function")) {
console.error(`${this.constructor.name} extends BaseStore<T>'s fromStore method returns a Promise or promise-like object. This is an error and must be fixed.`);
console.error(`${this.displayName} extends BaseStore<T>'s fromStore method returns a Promise or promise-like object. This is an error and must be fixed.`);
Copy link
Contributor

Choose a reason for hiding this comment

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

errors must go through console?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean instead of logger? That will be resolved by #4317

logger.info("[App]: Unload app");

window.addEventListener("beforeunload", () => {
logger.info(`${RootFrame.logPrefix} Unload app`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.info(`${RootFrame.logPrefix} Unload app`);
logger.info(`${RootFrame.logPrefix} Unload root frame`);

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that is necessary given that logPrefix is already "[ROOT-FRAME]:"

@Nokel81 Nokel81 merged commit 885af07 into master Nov 18, 2021
@Nokel81 Nokel81 deleted the improve-bootstrap-loggin branch November 18, 2021 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants