Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6dc3b99
Remove NIO and use Mutex (#208)
fpseverino May 6, 2025
537cba7
Remove `ConsoleKitCommands` (#209)
fpseverino May 19, 2025
e190904
Update `ActivityIndicator` for async/await, migrate to Swift Testing …
fpseverino May 30, 2025
435eaf6
Remove ConsoleKitPerformanceTests (#211)
fpseverino May 31, 2025
3473ddb
Remove Foundation (#212)
fpseverino Jun 2, 2025
ca482c4
Add various APIs (#213)
fpseverino Jul 2, 2025
1b5d770
Fix activity indicator bug and update API (#215)
fpseverino Aug 23, 2025
566ea3a
Remove `ConsoleFragmentLogger` (#218)
fpseverino Oct 8, 2025
8252efa
Add Benchmarks for ConsoleLogger (#222)
fpseverino Oct 12, 2025
5913ce3
LoggerFragmentBuilder (#221)
fpseverino Nov 3, 2025
774e9c8
Remove `ConsoleKit` from `ConsoleLogger` (#223)
fpseverino Nov 21, 2025
9241bb9
Adopt Swift Configuration (#225)
fpseverino Dec 4, 2025
e79a3b2
Update dependencies (#226)
fpseverino Dec 12, 2025
772b4c8
Rename `LoggingSystem.bootstrap` to `ConsoleLogger.bootstrap` (#227)
fpseverino Dec 12, 2025
893bbaf
Use suspending clock in ActivityIndicator (#228)
fpseverino Jan 20, 2026
97f03e0
Remove duplicate Swift settings (#229)
fpseverino Jan 23, 2026
b840676
Add default `ConfigReader` to `bootstrap()` and package trait (#230)
fpseverino Jan 31, 2026
5d05533
Cherry-pick the update for swift-log 1.11.0 from main (#233)
gwynne Apr 1, 2026
8313b62
Unify `LoggerFragmentBuilder` and `LoggerSpacedFragmentBuilder` (#231)
fpseverino Apr 7, 2026
7376228
Add permissions to benchmark.yml
gwynne Apr 7, 2026
c5c26f3
Merge branch 'main' into consolekit-5
gwynne Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
secrets: inherit
with:
package_name: console-kit
modules: ConsoleKit,ConsoleKitTerminal,ConsoleKitCommands
pathsToInvalidate: /consolekit/* /consolekitterminal/* /consolekitcommands/*
modules: ConsoleKit,ConsoleLogger
pathsToInvalidate: /consolekit/* /consolelogger/*
21 changes: 21 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: benchmark
on:
workflow_dispatch:
inputs:
sha:
type: string
required: true
description: "The commit SHA to run the benchmarks against."
push:
branches: [main]
permissions:
contents: read
id-token: write
pull-requests: write

jobs:
benchmark:
uses: vapor/ci/.github/workflows/run-benchmark.yml@main
with:
sha: ${{ inputs.sha }}
secrets: inherit
40 changes: 26 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@ jobs:
contents: read
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main
with:
with_windows: true
with_musl: true
with_windows: true
with_musl: true
with_android: true
with_linting: true
enable_all_traits: true
secrets: inherit

package-traits:
permissions:
contents: read
runs-on: ubuntu-latest
container: swift:noble
steps:
- name: Check out ConsoleKit
uses: actions/checkout@v6
- name: Run tests with traits disabled
run: swift test --disable-default-traits

submit-dependencies:
permissions:
Expand All @@ -25,15 +39,13 @@ jobs:
uses: vapor/ci/.github/workflows/submit-deps.yml@main
secrets: inherit

integration-check:
permissions:
contents: read
runs-on: ubuntu-latest
container: swift:noble
steps:
- uses: actions/checkout@v6
with: { path: console-kit }
- uses: actions/checkout@v6
with: { repository: 'vapor/vapor', path: vapor }
- run: swift package --package-path vapor edit console-kit --path console-kit
- run: swift test --package-path vapor
# integration-check:
# runs-on: ubuntu-latest
# container: swift:noble
# steps:
# - uses: actions/checkout@v6
# with: { path: console-kit }
# - uses: actions/checkout@v6
# with: { repository: 'vapor/vapor', path: vapor }
# - run: swift package --package-path vapor edit console-kit --path console-kit
# - run: swift test --package-path vapor
70 changes: 70 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"fileScopedDeclarationPrivacy": {
"accessLevel": "private"
},
"indentation": {
"spaces": 4
},
"indentConditionalCompilationBlocks": false,
"indentSwitchCaseLabels": false,
"lineBreakAroundMultilineExpressionChainComponents": false,
"lineBreakBeforeControlFlowKeywords": false,
"lineBreakBeforeEachArgument": false,
"lineBreakBeforeEachGenericRequirement": false,
"lineLength": 140,
"maximumBlankLines": 1,
"multiElementCollectionTrailingCommas": true,
"noAssignmentInExpressions": {
"allowedFunctions": [
"XCTAssertNoThrow"
]
},
"prioritizeKeepingFunctionOutputTogether": false,
"respectsExistingLineBreaks": true,
"rules": {
"AllPublicDeclarationsHaveDocumentation": false,
"AlwaysUseLiteralForEmptyCollectionInit": false,
"AlwaysUseLowerCamelCase": true,
"AmbiguousTrailingClosureOverload": true,
"BeginDocumentationCommentWithOneLineSummary": false,
"DoNotUseSemicolons": true,
"DontRepeatTypeInStaticProperties": true,
"FileScopedDeclarationPrivacy": true,
"FullyIndirectEnum": true,
"GroupNumericLiterals": true,
"IdentifiersMustBeASCII": true,
"NeverForceUnwrap": false,
"NeverUseForceTry": false,
"NeverUseImplicitlyUnwrappedOptionals": false,
"NoAccessLevelOnExtensionDeclaration": true,
"NoAssignmentInExpressions": true,
"NoBlockComments": true,
"NoCasesWithOnlyFallthrough": true,
"NoEmptyTrailingClosureParentheses": true,
"NoLabelsInCasePatterns": true,
"NoLeadingUnderscores": false,
"NoParensAroundConditions": true,
"NoPlaygroundLiterals": true,
"NoVoidReturnOnFunctionSignature": true,
"OmitExplicitReturns": false,
"OneCasePerLine": true,
"OneVariableDeclarationPerLine": true,
"OnlyOneTrailingClosureArgument": true,
"OrderedImports": true,
"ReplaceForEachWithForLoop": true,
"ReturnVoidInsteadOfEmptyTuple": true,
"TypeNamesShouldBeCapitalized": true,
"UseEarlyExits": false,
"UseExplicitNilCheckInConditions": true,
"UseLetInEveryBoundCaseVariable": true,
"UseShorthandTypeNames": true,
"UseSingleLinePropertyGetter": true,
"UseSynthesizedInitializer": true,
"UseTripleSlashForDocumentationComments": true,
"UseWhereClausesInForLoops": false,
"ValidateDocumentationComments": false
},
"spacesAroundRangeFormationOperators": false,
"tabWidth": 8,
"version": 1
}
10 changes: 10 additions & 0 deletions Benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.build
Packages
*.xcodeproj
Package.pins
Package.resolved
.DS_Store
DerivedData
.swiftpm
Tests/LinuxMain.swift
.vscode
1 change: 1 addition & 0 deletions Benchmarks/.swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import Benchmark
import ConsoleLogger
import Logging

let benchmarks: @Sendable () -> Void = {
Benchmark.defaultConfiguration = .init(
metrics: [.peakMemoryResident, .mallocCountTotal],
thresholds: [
.peakMemoryResident: .init(
// Tolerate up to 4% of difference compared to the threshold.
relative: [.p90: 4],
// Tolerate up to one million bytes of difference compared to the threshold.
absolute: [.p90: 1_100_000]
),
.mallocCountTotal: .init(
// Tolerate up to 1% of difference compared to the threshold.
relative: [.p90: 1],
// Tolerate up to 2 malloc calls of difference compared to the threshold.
absolute: [.p90: 2]
),
]
)

Benchmark(
"Logging",
configuration: .init(
setup: {
ConsoleLogger.bootstrap(
metadataProvider: .init {
["provided1": "from metadata provider", "provided2": "another metadata provider"]
}
)
}
)
) { benchmark in
var logger = Logger(label: "codes.vapor.console")
logger.logLevel = .trace
logger[metadataKey: "value"] = "one"

for _ in benchmark.scaledIterations {
logger.info(
"Info",
metadata: ["from-log": "value", "also-from-log": "other"]
)
}
}

Benchmark(
"LoggerFragmentBuilder",
configuration: .init(
setup: {
ConsoleLogger.bootstrap(
metadataProvider: .init {
["provided1": "from metadata provider", "provided2": "another metadata provider"]
}
) {
// This is the default logger fragment, but built using LoggerFragmentBuilder
SpacedFragment {
LabelFragment().maxLevel(.trace)
LevelFragment()
MessageFragment()
MetadataFragment()
SourceLocationFragment().maxLevel(.debug)
}
}
}
)
) { benchmark in
var logger = Logger(label: "codes.vapor.console")
logger.logLevel = .trace
logger[metadataKey: "value"] = "one"

for _ in benchmark.scaledIterations {
logger.info(
"Info",
metadata: ["from-log": "value", "also-from-log": "other"]
)
}
}
}
42 changes: 42 additions & 0 deletions Benchmarks/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// swift-tools-version:6.1
import PackageDescription

let package = Package(
name: "benchmarks",
platforms: [
.macOS(.v15)
],
dependencies: [
.package(path: "../"),
.package(url: "https://github.com/ordo-one/package-benchmark.git", from: "1.29.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.3"),
],
targets: [
.executableTarget(
name: "ConsoleLoggerBenchmarks",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
.product(name: "ConsoleLogger", package: "console-kit"),
.product(name: "ConsoleKit", package: "console-kit"),
.product(name: "Logging", package: "swift-log"),
],
path: "ConsoleLoggerBenchmarks",
swiftSettings: swiftSettings,
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
]
)
]
)

var swiftSettings: [SwiftSetting] {
[
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("InternalImportsByDefault"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("InferIsolatedConformances"),
.enableUpcomingFeature("ImmutableWeakCaptures"),
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mallocCountTotal" : 38,
"peakMemoryResident" : 11042816
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mallocCountTotal" : 30,
"peakMemoryResident" : 11108352
}
Loading
Loading