Skip to content

Commit f864d39

Browse files
authored
Add logs (#255)
1 parent 1845125 commit f864d39

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/app/standalone.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ async function onInitialize(params: ExtendedInitializeParams) {
3838

3939
// Dynamically load these modules so that OTEL can instrument all the libraries first
4040
const { CfnInfraCore } = await import('../server/CfnInfraCore');
41-
const { CfnServer } = await import('../server/CfnServer');
42-
4341
const core = new CfnInfraCore(lsp.components, params);
42+
43+
const { CfnServer } = await import('../server/CfnServer');
4444
server = new CfnServer(lsp.components, core);
4545
return LspCapabilities;
4646
}

src/datastore/LMDB.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class LMDBStoreFactory implements DataStoreFactory {
5858
private readonly stores = new Map<string, LMDBStore>();
5959

6060
constructor(private readonly rootDir: string = pathToArtifact('lmdb')) {
61+
log.info(`Initializing LMDB at ${rootDir} and version ${Version}`);
6162
this.storePath = join(rootDir, Version);
6263
this.env = open({
6364
path: this.storePath,
@@ -67,6 +68,7 @@ export class LMDBStoreFactory implements DataStoreFactory {
6768
encryptionKey: encryptionStrategy(Version),
6869
});
6970

71+
log.info('Setup LMDB guages');
7072
this.registerLMDBGauges();
7173

7274
this.timeout = setTimeout(

src/server/CfnServer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ import {
5050
describeChangeSetHandler,
5151
} from '../handlers/StackHandler';
5252
import { LspComponents } from '../protocol/LspComponents';
53+
import { LoggerFactory } from '../telemetry/LoggerFactory';
5354
import { withTelemetryContext } from '../telemetry/TelemetryContext';
5455
import { closeSafely } from '../utils/Closeable';
5556
import { CfnExternal } from './CfnExternal';
5657
import { CfnInfraCore } from './CfnInfraCore';
5758
import { CfnLspProviders } from './CfnLspProviders';
5859
import { ServerComponents } from './ServerComponents';
5960

61+
const log = LoggerFactory.getLogger('CfnServer');
6062
export class CfnServer {
6163
private readonly components: ServerComponents;
6264

@@ -66,12 +68,14 @@ export class CfnServer {
6668
private readonly external = new CfnExternal(lsp, core),
6769
private readonly providers = new CfnLspProviders(core, external),
6870
) {
71+
log.info('Initializing...');
6972
this.components = {
7073
...core,
7174
...external,
7275
...providers,
7376
};
7477

78+
log.info('Seting up handlers...');
7579
this.setupHandlers();
7680
}
7781

0 commit comments

Comments
 (0)