Skip to content

Commit 7af8b7a

Browse files
committed
Use BaseLogger instead of ExtLogger
1 parent a6b6b5a commit 7af8b7a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

extensions/ql-vscode/src/databases/code-search-api.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { throttling } from "@octokit/plugin-throttling";
33
import { Octokit } from "@octokit/rest";
44
import { Progress, CancellationToken } from "vscode";
55
import { Credentials } from "../common/authentication";
6-
import { extLogger } from "../common/logging/vscode/loggers";
6+
import { BaseLogger } from "../common/logging";
77

88
export async function getCodeSearchRepositories(
99
query: string,
@@ -13,9 +13,10 @@ export async function getCodeSearchRepositories(
1313
}>,
1414
token: CancellationToken,
1515
credentials: Credentials,
16+
logger: BaseLogger,
1617
): Promise<string[]> {
1718
let nwos: string[] = [];
18-
const octokit = await provideOctokitWithThrottling(credentials);
19+
const octokit = await provideOctokitWithThrottling(credentials, logger);
1920

2021
for await (const response of octokit.paginate.iterator(
2122
octokit.rest.search.code,
@@ -43,6 +44,7 @@ export async function getCodeSearchRepositories(
4344

4445
async function provideOctokitWithThrottling(
4546
credentials: Credentials,
47+
logger: BaseLogger,
4648
): Promise<Octokit> {
4749
const MyOctokit = Octokit.plugin(throttling);
4850
const auth = await credentials.getAccessToken();
@@ -52,14 +54,14 @@ async function provideOctokitWithThrottling(
5254
retry,
5355
throttle: {
5456
onRateLimit: (retryAfter: number, options: any): boolean => {
55-
void extLogger.log(
57+
void logger.log(
5658
`Rate Limit detected for request ${options.method} ${options.url}. Retrying after ${retryAfter} seconds!`,
5759
);
5860

5961
return true;
6062
},
6163
onSecondaryRateLimit: (_retryAfter: number, options: any): void => {
62-
void extLogger.log(
64+
void logger.log(
6365
`Secondary Rate Limit detected for request ${options.method} ${options.url}`,
6466
);
6567
},

extensions/ql-vscode/src/databases/ui/db-panel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ export class DbPanel extends DisposableObject {
423423
progress,
424424
token,
425425
this.app.credentials,
426+
this.app.logger,
426427
);
427428

428429
token.onCancellationRequested(() => {

0 commit comments

Comments
 (0)