Skip to content

Commit 42f191c

Browse files
committed
remove logging of secrets
1 parent a5cc4bc commit 42f191c

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

src/kernels/deepnote/deepnoteServerStarter.node.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,7 @@ export class DeepnoteServerStarter implements IDeepnoteServerStarter, IExtension
169169
} SQL integration env vars: ${Object.keys(sqlEnvVars).join(', ')}`
170170
);
171171
Object.assign(env, sqlEnvVars);
172-
// Log the first 100 chars of each env var value for debugging
173-
for (const [key, value] of Object.entries(sqlEnvVars)) {
174-
if (value) {
175-
logger.info(`DeepnoteServerStarter: ${key} = ${value.substring(0, 100)}...`);
176-
}
177-
}
172+
logger.info(`DeepnoteServerStarter: Injected SQL env vars: ${Object.keys(sqlEnvVars).join(', ')}`);
178173
} else {
179174
logger.info('DeepnoteServerStarter: No SQL integration env vars to inject');
180175
}

src/kernels/kernel.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -853,22 +853,22 @@ abstract class BaseKernel implements IBaseKernel {
853853

854854
// Gather all of the startup code at one time and execute as one cell
855855
const startupCode = await this.gatherInternalStartupCode();
856-
logger.info(`Executing startup code with ${startupCode.length} lines`);
856+
logger.trace(`Executing startup code with ${startupCode.length} lines`);
857+
857858
const outputs = await this.executeSilently(session, startupCode, {
858859
traceErrors: true,
859860
traceErrorsMessage: 'Error executing jupyter extension internal startup code'
860861
});
861-
logger.info(`Startup code execution completed with ${outputs?.length || 0} outputs`);
862+
logger.trace(`Startup code execution completed with ${outputs?.length || 0} outputs`);
862863
if (outputs && outputs.length > 0) {
863-
outputs.forEach((output, idx) => {
864-
logger.info(
865-
`Startup code output ${idx}: ${output.output_type} - ${JSON.stringify(output).substring(
866-
0,
867-
200
868-
)}`
869-
);
870-
});
864+
// Avoid logging content; output types only.
865+
logger.trace(
866+
`Startup code produced ${outputs.length} output(s): ${outputs
867+
.map((o) => o.output_type)
868+
.join(', ')}`
869+
);
871870
}
871+
872872
// Run user specified startup commands
873873
await this.executeSilently(session, this.getUserStartupCommands(), { traceErrors: false });
874874
}

src/notebooks/deepnote/integrations/sqlIntegrationStartupCodeProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ export class SqlIntegrationStartupCodeProvider implements IStartupCodeProvider,
105105
code.push(' print(f"[SQL Integration] ERROR: Failed to set SQL integration env vars: {e}")');
106106
code.push(' traceback.print_exc()');
107107

108-
const fullCode = code.join('\n');
109-
logger.info(`SqlIntegrationStartupCodeProvider: Generated startup code (${fullCode.length} chars):`);
110-
logger.info(fullCode);
108+
logger.info('SqlIntegrationStartupCodeProvider: Generated startup code');
111109

112110
return code;
113111
} catch (error) {

src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ export class SqlIntegrationEnvironmentVariablesProvider {
147147
logger.info(
148148
`SqlIntegrationEnvironmentVariablesProvider: Added env var ${envVarName} for integration ${integrationId}`
149149
);
150-
logger.info(
151-
`SqlIntegrationEnvironmentVariablesProvider: Env var value: ${credentialsJson.substring(0, 100)}...`
152-
);
153150
} catch (error) {
154151
logger.error(
155152
`SqlIntegrationEnvironmentVariablesProvider: Failed to get credentials for integration ${integrationId}`,

0 commit comments

Comments
 (0)