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

Logger: also count the warning messages #1205

Merged
merged 4 commits into from Feb 15, 2020

Conversation

PissedCapslock
Copy link
Contributor

If you want to make your build fail on error messages, you currently can do

const result = app.generateDocs(project, OUTPUT_DIR);
if (!result || app.logger.hasErrors() ) {
  console.log("Errors were logged during the generation of the documentation. Check the log for more information");
  process.exit(1);
}

However, warning messages typically indicate a problem as well. If you want to make your build fail on those as well, you need a custom logger to keep track of the warning messages yourself.

This PR makes this easier by counting the warning messages in a similar fashion as the error messages.

If you want to make your build fail on error messages, you currently can do
```
const result = app.generateDocs(project, OUTPUT_DIR);
if (!result || app.logger.hasErrors() ) {
  console.log("Errors were logged during the generation of the documentation. Check the log for more information");
  process.exit(1);
}
```

However, warning messages typically indicate a problem as well. If you want to make your build fail on those as well, you need a custom logger to keep track of the warning messages yourself.

This PR makes this easier by counting the warning messages in a similar fashion as the error messages.
Removing some trailing whitespace
@Gerrit0 Gerrit0 merged commit c75df1c into TypeStrong:master Feb 15, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 15, 2020

Looks good, thanks! I'll put out a patch with this this weekend.

@PissedCapslock PissedCapslock deleted the patch-3 branch February 15, 2020 22:33
@PissedCapslock
Copy link
Contributor Author

Thanks.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 16, 2020

Released in 0.16.10

PissedCapslock added a commit to PissedCapslock/typedoc that referenced this pull request Feb 18, 2020
I cannot believe I messed up that previous PR (TypeStrong#1205), but the extensions of the `Logger` class did not count the warnings.
Solved this by removing the error counting code from the child classes, and called the super method instead.
This ensures that both the error count and the warning count increases.
Gerrit0 pushed a commit that referenced this pull request Feb 22, 2020
I cannot believe I messed up that previous PR (#1205), but the extensions of the `Logger` class did not count the warnings.
Solved this by removing the error counting code from the child classes, and called the super method instead.
This ensures that both the error count and the warning count increases.
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.

None yet

2 participants