Skip to content

Commit

Permalink
refactor(logs): drop "Amazon Q Logs" channel and just have "Amazon Q"
Browse files Browse the repository at this point in the history
Problem

We didn't have much use for the old "Amazon Q" channel in addition to
"Amazon Q Logs". All the logs we used were in "Amazon Q Logs".

Solution

Now, just have the useful "Amazon Q Logs" channel, but it will be renamed
to just "Amazon Q".

Signed-off-by: nkomonen-amazon <[email protected]>
  • Loading branch information
nkomonen-amazon committed Nov 27, 2024
1 parent ecaf77f commit 9440447
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions packages/amazonq/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
globals.manifestPaths.endpoints = context.asAbsolutePath(join('resources', 'endpoints.json'))
globals.regionProvider = RegionProvider.fromEndpointsProvider(makeEndpointsProvider())

const qOutputChannel = vscode.window.createOutputChannel('Amazon Q', { log: true })
const qLogChannel = vscode.window.createOutputChannel('Amazon Q Logs', { log: true })
await activateLogger(context, amazonQContextPrefix, qOutputChannel, qLogChannel)
globals.outputChannel = qOutputChannel
const qLogChannel = vscode.window.createOutputChannel('Amazon Q', { log: true })
await activateLogger(context, amazonQContextPrefix, qLogChannel)
globals.logOutputChannel = qLogChannel
globals.loginManager = new LoginManager(globals.awsContext, new CredentialsStore())

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function activateCommon(
// Setup the logger
const toolkitOutputChannel = vscode.window.createOutputChannel('AWS Toolkit', { log: true })
const toolkitLogChannel = vscode.window.createOutputChannel('AWS Toolkit Logs', { log: true })
await activateLogger(context, contextPrefix, toolkitOutputChannel, toolkitLogChannel)
await activateLogger(context, contextPrefix, toolkitLogChannel, toolkitOutputChannel)
globals.outputChannel = toolkitOutputChannel
globals.logOutputChannel = toolkitLogChannel

Expand Down
8 changes: 5 additions & 3 deletions packages/core/src/shared/logger/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import { isBeta } from '../vscode/env'

/**
* Activate Logger functionality for the extension.
*
* @param outputChannel optional output channel for less granular logs
*/
export async function activate(
extensionContext: vscode.ExtensionContext,
contextPrefix: string,
outputChannel: vscode.LogOutputChannel,
logChannel: vscode.LogOutputChannel
logChannel: vscode.LogOutputChannel,
outputChannel?: vscode.LogOutputChannel
): Promise<void> {
const settings = Settings.instance.getSection('aws')
const devLogfile = settings.get('dev.logfile', '')
Expand Down Expand Up @@ -52,7 +54,7 @@ export async function activate(
setLogger(
makeLogger({
logLevel: chanLogLevel,
outputChannels: [outputChannel, logChannel],
outputChannels: outputChannel ? [outputChannel, logChannel] : [logChannel],
useConsoleLog: true,
}),
'debugConsole'
Expand Down

0 comments on commit 9440447

Please sign in to comment.