yarn add crawlee-pino
- Create a Pino logger
import pino from 'pino'
const pinoLogger = pino()
- Create a CrawleePino logger
import { CrawleePino } from 'crawlee-pino'
const crawleePinoLogger = new CrawleePino({ pino: pinoLogger })
- Assign the logger to Crawlee
import { PuppeteerCrawler, Log } from 'crawlee'
const crawler = new PuppeteerCrawler({
log: new Log({ logger: crawleePinoLogger }),
})
- Run your crawler
await crawler.run(['https://crawlee.dev'])
import pino from 'pino'
import { PuppeteerCrawler, Log } from 'crawlee'
import { CrawleePino } from 'crawlee-pino'
export const logger = pino()
export const crawler = new PuppeteerCrawler({
log: new Log({
logger: new CrawleePino({ pino: logger.child({ tag: 'crawlee' }) }),
}),
})
await crawler.run(['https://crawlee.dev'])
Apache-2.0 © yelo, 2023 - present