@@ -22,7 +22,6 @@ import {
2222} from '@aws/language-server-runtimes/protocol'
2323import { AuthUtil , CodeWhispererSettings , getSelectedCustomization } from 'aws-core-vscode/codewhisperer'
2424import {
25- Settings ,
2625 oidcClientName ,
2726 createServerOptions ,
2827 globals ,
@@ -36,6 +35,7 @@ import {
3635} from 'aws-core-vscode/shared'
3736import { activate } from './chat/activation'
3837import { AmazonQResourcePaths } from './lspInstaller'
38+ import { getLspLogLevel } from './config'
3939
4040const localize = nls . loadMessageBundle ( )
4141const logger = getLogger ( 'amazonqLsp.lspClient' )
@@ -61,11 +61,11 @@ export async function startLanguageServer(
6161 serverModule,
6262 execArgv : argv ,
6363 } )
64-
64+ const clientId = `amazonq`
6565 const documentSelector = [ { scheme : 'file' , language : '*' } ]
66+ const lspLogSettings = getLspLogLevel ( clientId )
6667
67- const clientId = 'amazonq'
68- const traceServerEnabled = Settings . instance . isSet ( `${ clientId } .trace.server` )
68+ getLogger ( 'amazonqLsp' ) . info ( `Sending log settings to lsp: %O` , lspLogSettings )
6969
7070 await validateNodeExe ( resourcePaths . node , resourcePaths . lsp , argv , logger )
7171
@@ -139,6 +139,7 @@ export async function startLanguageServer(
139139 } ,
140140 } ,
141141 } ,
142+ logLevel : lspLogSettings . lspLogLevel ,
142143 credentials : {
143144 providesBearerToken : true ,
144145 } ,
@@ -148,7 +149,7 @@ export async function startLanguageServer(
148149 * When trace server is enabled, logs go to a seperate "Amazon Q Language Server" output.
149150 * Otherwise, logs go to the regular "Amazon Q Logs" channel.
150151 */
151- ...( traceServerEnabled
152+ ...( lspLogSettings . seperateTraceChannel
152153 ? { }
153154 : {
154155 outputChannel : globals . logOutputChannel ,
0 commit comments