Skip to content

Overhaul README and documentation catalog to introduce best practices #363

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 1 commit into from
Jul 9, 2025

Conversation

FranzBusch
Copy link
Member

@FranzBusch FranzBusch commented Jul 8, 2025

Motivation

SwiftLog was created before DocC existed which meant that most of the documentation was part of the README and we had a pretty bare bones documentation catalog. We also have a second source of guidelines from the SSWG. This results in a currently unsatisfying developer experience where everyone has to go around looking for the content in mostly undocumented places.

Modifications

This PR overhauls the README and moves most of the content into the documentation catalog. It also introduces a new section called "Best practices" that are intended to replace the logging guides on swift.org so that the content moves closer to where it belongs. To showcase such a best practice this PR brings over the log level recommendation of swift.org. The recommendation is mostly the same except that after recent discussions we wanted to allow libraries to log at info level when they encounter problems which they can't communicate through other channels e.g. by throwing from a method.

Result

With this PR we provide a nicer experience to our developers making it easier for them to get started and understand how to properly log. We also set ourselves up for expanding on the best practices around logging.

@FranzBusch FranzBusch requested a review from ktoso July 8, 2025 12:06
@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch from 3db3c66 to 0ac66ff Compare July 8, 2025 12:08
@FranzBusch FranzBusch added the semver/none No version bump required. label Jul 8, 2025
Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Looks good overall, some suggestions inline.

@sebsto
Copy link

sebsto commented Jul 8, 2025

Shouldn't we keep the section about implementing a LogHandler and related best practices ? It might be a different file to not clutter the main doc that most developer need.

## On the implementation of a logging backend (a `LogHandler`)

@FranzBusch
Copy link
Member Author

@sebsto I have another document that moves this into a guide. You mind if I land this in a follow-up?

@sebsto
Copy link

sebsto commented Jul 8, 2025

@FranzBusch Great ! I just wanted to be sure it's not forgotten

@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch 2 times, most recently from d72cf2c to 2ae3e90 Compare July 8, 2025 14:09
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

Thank you! Long overdue :)

Copy link
Contributor

@heckj heckj left a comment

Choose a reason for hiding this comment

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

a few grammar tweaks - removing latin abbreviations, spelling out an acronym, and making some of the wording more direct.

@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch from 2ae3e90 to 15c3584 Compare July 8, 2025 15:36
@FranzBusch FranzBusch requested a review from heckj July 8, 2025 15:38
Copy link
Contributor

@heckj heckj left a comment

Choose a reason for hiding this comment

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

The top level page for swift-docs is pretty long - it may benefit from breaking up into separate articles on getting started and core concepts, but I don't think that's critically needed for this update.

I went back with my fine-toothed comb and suggested some punctuation, grammar, and style fixes - and restricting the best practices page to use ## Topics to make it a page that explicitly links to others (aka API Topic Reference page) to hold the best practices without a lot of extra redundancy.

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

A few comments, looks great otherwise!

@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch 2 times, most recently from 0ac334b to 3ac92c6 Compare July 9, 2025 07:06
@FranzBusch FranzBusch requested review from czechboy0 and heckj July 9, 2025 07:06
@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch 2 times, most recently from 25106b1 to 929bce2 Compare July 9, 2025 07:07
Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks 🙏

Copy link

@tib tib left a comment

Choose a reason for hiding this comment

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

The changes look good. I like that you have included practical examples of both good and bad practices.

# Motivation

`SwiftLog` was created before DocC existed which meant that most of the documentation was part of the `README` and we had a pretty bare bones documentation catalog. We also have a second source of guidelines from the SSWG. This results in a currently unsatisfying developer experience where everyone has to go around looking for the content in mostly undocumented places.

# Modifications

This PR overhauls the `README` and moves most of the content into the documentation catalog. It also introduces a new section called "Best practices" that are intended to replace the logging guides on swift.org so that the content moves closer to where it belongs. To showcase such a best practice this PR brings over the log level recommendation of swift.org. The recommendation is mostly the same except that after recent discussions we wanted to allow libraries to log at `info` level when they encounter problems which they can't communicate through other channels e.g. by throwing from a method.

# Result

With this PR we provide a nicer experience to our developers making it easier for them to get started and understand how to properly log. We also set ourselves up for expanding on the best practices around logging.
@FranzBusch FranzBusch force-pushed the fb-readme-doc-overhaul branch from 929bce2 to 8908b0d Compare July 9, 2025 11:02
Copy link
Contributor

@heckj heckj left a comment

Choose a reason for hiding this comment

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

Awesome, thanks Franz!

@FranzBusch FranzBusch merged commit c05d672 into apple:main Jul 9, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants