-
Notifications
You must be signed in to change notification settings - Fork 18
Improvements to logging in the app using swift-log and structured logging #168
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
Improvements to logging in the app using swift-log and structured logging #168
Conversation
- Easier for structured logging.
- And pass a logger to the SwiftSDKRecipe and implementation to be used as well.
I wonder if we should introduce a |
Looks like there is already a
So I think setting all of these to |
So what I ended up doing was setting some of the key actions to $ swift run swift-sdk-generator make-linux-sdk --swift-version 6.0.3-RELEASE --host x86_64-unknown-linux-gnu --t
arget aarch64-unknown-linux-gnu
Building for debugging...
[12/12] Linking swift-sdk-generator
Build of product 'swift-sdk-generator' complete! (2.39s)
2025-01-17T18:33:56-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Downloading required toolchain packages...
2025-01-17T18:33:57-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Using downloaded artifacts from cache
2025-01-17T18:33:59-0500 info org.swift.swift-sdk-generator : packageCount=11 [SwiftSDKGenerator] Downloading Ubuntu packages...
2025-01-17T18:34:01-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Unpacking and copying Swift binaries for the host triple...
2025-01-17T18:34:13-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Unpacking Swift distribution for the target triple...
2025-01-17T18:34:25-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Copying Swift core libraries for the target triple into Swift SDK bundle...
2025-01-17T18:34:26-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Fixing up absolute symlinks...
2025-01-17T18:34:27-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Generating toolset JSON file...
2025-01-17T18:34:27-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Generating destination JSON file...
2025-01-17T18:34:27-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator] Generating .artifactbundle info JSON file...
2025-01-17T18:34:27-0500 info org.swift.swift-sdk-generator : [SwiftSDKGenerator]
All done! Install the newly generated SDK with this command:
swift experimental-sdk install ~/swift-sdk-generator/Bundles/6.0.3-RELEASE_ubuntu_jammy_aarch64.artifactbundle
After that, use the newly installed SDK when building with this command:
swift build --experimental-swift-sdk 6.0.3-RELEASE_ubuntu_jammy_aarch64
2025-01-17T18:34:27-0500 info org.swift.swift-sdk-generator : elapsedTime=31 seconds [GeneratorCLI] Generator run finished successfully. However, when you pass |
Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift
Outdated
Show resolved
Hide resolved
- This was missed in the last set of changes, but important to note that the generator can now generate Swift SDKs to cross compile between different Linux distributions.
@swift-ci test |
@MaxDesiatov I fixed the merge conflict. Sorry I didn't notice before- I came by a few times and just saw green checkmarks and not the conflict. Please let me know if there's anything else here you'd like to me look at or refine! |
LGTM, but I'd like to get some feedback from @euanh and @kateinoigakukun |
@swift-ci test |
@swift-ci test |
This is a draft since I've only done the initial set of changes. The output currently looks like this with the
logger
being used almost everywhere, and with structured logging being used:So, questions:
I haven't figured out how to change the logger output format, but I can have a look a bit later.