mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add trace debug logging to OE service (#21617)
* Add trace debug logging to OE service * cleanup
This commit is contained in:
@@ -238,16 +238,19 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let sessionStatus = this._sessions[expandResponse.sessionId!];
|
let sessionStatus = this._sessions[expandResponse.sessionId!];
|
||||||
let foundSession = false;
|
|
||||||
if (sessionStatus) {
|
if (sessionStatus) {
|
||||||
let nodeStatus = this._sessions[expandResponse.sessionId!].nodes[expandResponse.nodePath];
|
const nodeStatus = sessionStatus.nodes[expandResponse.nodePath];
|
||||||
foundSession = !!nodeStatus;
|
if (nodeStatus) {
|
||||||
if (foundSession && nodeStatus.expandEmitter) {
|
if (!nodeStatus.expandEmitter) {
|
||||||
nodeStatus.expandEmitter.fire(expandResponse);
|
this.logService.warn(`No expand emitter for session: ${expandResponse.sessionId} and node path: ${expandResponse.nodePath}`);
|
||||||
|
} else {
|
||||||
|
nodeStatus.expandEmitter.fire(expandResponse);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.logService.warn(`Cannot find node status for session: ${expandResponse.sessionId} and node path: ${expandResponse.nodePath}`);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (!foundSession) {
|
this.logService.warn(`Cannot find session ${expandResponse.sessionId} for node path: ${expandResponse.nodePath}`);
|
||||||
this.logService.warn(`Cannot find node status for session: ${expandResponse.sessionId} and node path: ${expandResponse.nodePath}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,11 +354,13 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
const provider = this._providers[providerId];
|
const provider = this._providers[providerId];
|
||||||
if (provider) {
|
if (provider) {
|
||||||
const result = await provider.createNewSession(connection.toConnectionInfo());
|
const result = await provider.createNewSession(connection.toConnectionInfo());
|
||||||
|
if (this._sessions[result.sessionId]) {
|
||||||
|
this.logService.trace(`Overwriting session ${result.sessionId}`);
|
||||||
|
}
|
||||||
this._sessions[result.sessionId] = {
|
this._sessions[result.sessionId] = {
|
||||||
connection: connection,
|
connection: connection,
|
||||||
nodes: {}
|
nodes: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Provider doesn't exist. id: ${providerId}`);
|
throw new Error(`Provider doesn't exist. id: ${providerId}`);
|
||||||
@@ -397,6 +402,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
self._sessions[session.sessionId!].nodes[node.nodePath] = {
|
self._sessions[session.sessionId!].nodes[node.nodePath] = {
|
||||||
expandEmitter: new Emitter<NodeExpandInfoWithProviderId>()
|
expandEmitter: new Emitter<NodeExpandInfoWithProviderId>()
|
||||||
};
|
};
|
||||||
|
this.logService.trace(`Adding node ${node.nodePath} to session ${session.sessionId}`);
|
||||||
newRequest = true;
|
newRequest = true;
|
||||||
}
|
}
|
||||||
let provider = this._providers[providerId];
|
let provider = this._providers[providerId];
|
||||||
@@ -437,6 +443,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
// Have to delete it after get all responses otherwise couldn't find session for not the first response
|
// Have to delete it after get all responses otherwise couldn't find session for not the first response
|
||||||
if (newRequest) {
|
if (newRequest) {
|
||||||
delete self._sessions[session.sessionId!].nodes[node.nodePath];
|
delete self._sessions[session.sessionId!].nodes[node.nodePath];
|
||||||
|
this.logService.trace(`Deleted node ${node.nodePath} from session ${session.sessionId}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user