Skip to content

Remove ConsoleKit from ConsoleLogger#223

Merged
fpseverino merged 8 commits intovapor:consolekit-5from
fpseverino:remove-consolekit-dep
Nov 21, 2025
Merged

Remove ConsoleKit from ConsoleLogger#223
fpseverino merged 8 commits intovapor:consolekit-5from
fpseverino:remove-consolekit-dep

Conversation

@fpseverino
Copy link
Copy Markdown
Member

@fpseverino fpseverino commented Nov 4, 2025

Remove the dependency on ConsoleKit from ConsoleLogger

The downsides are that it's less customizable, both in the text output and in the console behavior, and now unit tests for ConsoleLogger are basically impossible, since we can't mock a Console.

However, if the user (e.g. Vapor itself) only needed ConsoleLogger, the build size should be smaller(?)

What do you think? Is it worth it?

@fpseverino
Copy link
Copy Markdown
Member Author

New benchmark results
==================================================================================
Deviations better than threshold for ConsoleLoggerBenchmarks:LoggerFragmentBuilder
==================================================================================
╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Memory (resident peak) (M, Δ)            │   p90 threshold │     Current_run │    Difference Δ │     Threshold Δ │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              14 │              11 │              -3 │               1 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Memory (resident peak) (M, %)            │   p90 threshold │     Current_run │    Difference % │     Threshold % │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              14 │              11 │             -21 │               4 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Malloc (total) (#, Δ)                    │   p90 threshold │     Current_run │    Difference Δ │     Threshold Δ │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              52 │              38 │             -14 │               2 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Malloc (total) (#, %)                    │   p90 threshold │     Current_run │    Difference % │     Threshold % │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              52 │              38 │             -26 │               1 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

====================================================================
Deviations better than threshold for ConsoleLoggerBenchmarks:Logging
====================================================================
╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Memory (resident peak) (M, Δ)            │   p90 threshold │     Current_run │    Difference Δ │     Threshold Δ │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              13 │              11 │              -2 │               1 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Memory (resident peak) (M, %)            │   p90 threshold │     Current_run │    Difference % │     Threshold % │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              13 │              11 │             -15 │               4 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Malloc (total) (#, Δ)                    │   p90 threshold │     Current_run │    Difference Δ │     Threshold Δ │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              48 │              30 │             -18 │               2 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

╒══════════════════════════════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╕
│ Malloc (total) (#, %)                    │   p90 threshold │     Current_run │    Difference % │     Threshold % │
╞══════════════════════════════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╡
│ p90                                      │              48 │              30 │             -37 │               1 │
╘══════════════════════════════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╛

The baseline 'Current_run' is BETTER than the defined thresholds.

@fpseverino fpseverino marked this pull request as ready for review November 17, 2025 10:57
Copy link
Copy Markdown
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

Ok so I think the source changes to this are good. I think it's important to ensure the logger is as efficient as possible so removing the console is right. If we care about testing I think we can introduce a simple protocol that we can send the output to and in tests introduce a capturing implementation to inspect

@fpseverino fpseverino requested a review from 0xTim November 17, 2025 21:43
@fpseverino fpseverino requested a review from 0xTim November 18, 2025 10:23
@fpseverino fpseverino merged commit 774e9c8 into vapor:consolekit-5 Nov 21, 2025
16 checks passed
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.

2 participants