Repository navigation
Conversation
The output channel is a LogOutputChannel, which already stamps the time
and level on every line, yet the logger prepended its own and wrote
through appendLine, so every line carried two timestamps and two levels
and warnings and errors were recorded as info. A concatenation bug also
repeated the whole prefix whenever a message accompanied the data. The
logger now writes through the channel's own debug/info/warn/error with
only the component name, and errors print their stack instead of "{}".
Other IDE clients of the language server contribute the identical
aws.cloudformation.telemetry.enabled setting, so a choice recorded by one
extension switched telemetry on or off for the other. The opt-in setting
now lives in this extension's own namespace as aws.iac.telemetry.enabled.
The globalState keys are unchanged: VS Code scopes them per extension.
Users who answered the 1.0.0 prompt are asked once more, since their
choice is stored under the old key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every line in the AWS CloudFormation output channel carried two timestamps and two levels, for example
2026-10-02 13:25:35.011 [info] [01:25:34 PM] Info: [Extension] Activating v1.0.0. Since #187 the channel is aLogOutputChannel, which stamps the time and level on each entry itself, butLoggerstill prepended its own[time] Level: [Component]prefix and wrote throughappendLine. ALogOutputChannelrecordsappendLineoutput at info level, so every warning and error was tagged[info]and the Output view's level filter and coloring were wrong for them. Two further bugs sat in the same method:line += `${line} ${message}`repeated the whole prefix whenever a message accompanied the data, which is the shape of everylog.warn(err, '...')andlog.error(err, '...')call, andtoString(error)rendered anErroras{}because the pretty-printer only sees enumerable properties, so error logs lost the error itself.The telemetry opt-in was stored in
aws.cloudformation.telemetry.enabled. Other IDE clients of the language server contribute a setting with that exact id, so a choice recorded by one extension switched telemetry on or off for the other, and whichever wrote last won.Solution
Loggertakes aLogOutputChanneland writes through itsdebug,info,warnanderrormethods, adding only the[Component]prefix. The hand-rolled time and level formatting is gone, the message is appended once, and anErrorprints its stack, falling back toextractErrorMessage. Theaws.cloudformation.telemetry.logLevelgate is unchanged.tst/utils/Logger.test.tscovers the level routing, the single prefix, the error rendering and the configured level; thevscodemock gains theLogOutputChannelmethods and the existing test call sites create their channel with{ log: true }so they type-check against it.The opt-in setting moves to
aws.iac.telemetry.enabled, a namespace this extension already owns (aws-iac-vscode,iac-vscode).TelemetryOptIn.tsreads and writes the new key, the prompt names the setting it writes, thepackage.jsoncontribution replaces the stale description, and the README settings table and Telemetry section follow. The globalState keys are unchanged because VS Code scopes them per extension, so they never collided.tst/telemetry/TelemetryOptIn.test.tspins the key: a recorded choice is read fromaws.iac.telemetry.enabled, a value underaws.cloudformation.telemetry.enabledis ignored, and a prompt answer is persisted only under the new key.The README also drops the Downloads badge.
Behavior changes
Output lines read
2026-10-02 13:25:35.011 [info] [Extension] Activating v1.0.0, and warnings and errors carry their real level, so the Output view's level filter and coloring apply to them. Errors logged with data print their stack instead of{}. Debug lines go throughLogOutputChannel.debug, which VS Code shows only when the channel's log level is set to Debug or Trace (Output view, "Set Log Level..."); with the default Info level, settingaws.cloudformation.telemetry.logLeveltodebugalone no longer surfaces them.A user who enabled telemetry on 1.0.0 is not prompted again: the
hasRespondedflag persists in globalState and the new setting reads as its default, so telemetry stays off untilaws.iac.telemetry.enabledis turned on. A value left underaws.cloudformation.telemetry.enabledis no longer read by this extension.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.