Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix timestamp in log output #2245

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/commands/importDocuments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function importDocuments(context: IActionContext, uris: vscode.Uri[
});
if (ignoredUris.length) {
ext.outputChannel.appendLog(`Ignoring the following files which are not json:`);
ignoredUris.forEach(uri => ext.outputChannel.appendLine(`${uri.fsPath}`));
ignoredUris.forEach(uri => ext.outputChannel.appendLog(`${uri.fsPath}`));
ext.outputChannel.show();
}
if (!collectionNode) {
Expand Down Expand Up @@ -100,7 +100,7 @@ async function parseDocuments(uris: vscode.Uri[]): Promise<any[]> {
ext.outputChannel.show();
}
const err = parseError(e);
ext.outputChannel.appendLine(`${uri.path}:\n${err.message}`);
ext.outputChannel.appendLog(`${uri.path}:\n${err.message}`);
}
if (parsed) {
if (Array.isArray(parsed)) {
Expand Down Expand Up @@ -132,7 +132,7 @@ async function insertDocumentsIntoDocdb(collectionNode: DocDBCollectionTreeItem,
}
if (erroneousFiles.length) {
ext.outputChannel.appendLog(`The following documents do not contain the required partition key:`);
erroneousFiles.forEach(file => ext.outputChannel.appendLine(file.path));
erroneousFiles.forEach(file => ext.outputChannel.appendLog(file.path));
ext.outputChannel.show();
throw new Error(`See output for list of documents that do not contain the partition key '${nonNullProp(collectionNode, 'partitionKey').paths[0]}' required by collection '${collectionNode.label}'`);
}
Expand All @@ -144,7 +144,7 @@ async function insertDocumentsIntoDocdb(collectionNode: DocDBCollectionTreeItem,
}
const result: string = `Import into SQL successful. Inserted ${ids.length} document(s). See output for more details.`;
for (const id of ids) {
ext.outputChannel.appendLine(`Inserted document: ${id}`);
ext.outputChannel.appendLog(`Inserted document: ${id}`);
}
return result;
}
Expand All @@ -156,7 +156,7 @@ async function insertDocumentsIntoMongo(node: MongoCollectionTreeItem, documents
if (parsed.acknowledged) {
output = `Import into mongo successful. Inserted ${parsed.insertedCount} document(s). See output for more details.`;
for (const inserted of Object.values(parsed.insertedIds)) {
ext.outputChannel.appendLine(`Inserted document: ${inserted}`);
ext.outputChannel.appendLog(`Inserted document: ${inserted}`);
}
}
return output;
Expand Down
2 changes: 1 addition & 1 deletion src/postgres/commands/executePostgresQueryInDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function executePostgresQueryInDocument(context: IActionContext): P

const query: string | undefined = activeEditor.document.getText();
const queryResult: QueryResult = await runPostgresQuery(clientConfig, query);
ext.outputChannel.appendLine(localize('executedQuery', 'Successfully executed "{0}" query.', queryResult.command));
ext.outputChannel.appendLog(localize('executedQuery', 'Successfully executed "{0}" query.', queryResult.command));

if (queryResult.rowCount) {
const fileExtension: string = path.extname(activeEditor.document.fileName);
Expand Down