Skip to content

Expose crawler._logger to public #303

@vdusek

Description

@vdusek

Currently, we expose the logger instance only through the context, e.g.:

    @crawler.router.default_handler
    async def request_handler(context: BeautifulSoupCrawlingContext) -> None:
        context.log.info(f'Processing {context.request.url}...')

We could expose it on the Crawler level as well. To be able to log stuff without logger initialization outside of the request handler.

crawler = BeautifulSoupCrawler()
crawler.log.info('Starting...')

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions