Skip to content

Commit

Permalink
fix: make crawler.log publicly accessible (#2526)
Browse files Browse the repository at this point in the history
This is important for being able to easily change log level for the
crawler.

```ts
crawler.log.setLevel(LogLevel.DEBUG);
```
  • Loading branch information
B4nan committed Jun 10, 2024
1 parent c1d6ac5 commit 3e9e665
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/basic-crawler/src/internals/basic-crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export class BasicCrawler<Context extends CrawlingContext = BasicCrawlingContext
running = false;
hasFinishedBefore = false;

protected log: Log;
readonly log: Log;
protected requestHandler!: RequestHandler<Context>;
protected errorHandler?: ErrorHandler<Context>;
protected failedRequestHandler?: ErrorHandler<Context>;
Expand Down
1 change: 1 addition & 0 deletions packages/http-crawler/src/internals/http-crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ export class HttpCrawler<
gotOptions,
}: RequestFunctionOptions): Promise<PlainResponse> {
if (!TimeoutError) {
// @ts-ignore
({ TimeoutError } = await import('got-scraping'));
}

Expand Down

0 comments on commit 3e9e665

Please sign in to comment.