How to extend log messages?

Are there any plans to extend Crawlee logger?
Ref: https://crawlee.dev/api/core/class/Logger

I found this to set the skipTime option
const Apify = require('apify');

const { utils: { log } } = Apify;

log.setOptions({
    logger: new log.LoggerText({ skipTime: false }),
});

but it doesn't seem to work. I got Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'log')

My code:
import Apify from 'apify'
const { utils: { log } } = Apify;

log.setOptions({
    logger: new log.LoggerText({ skipTime: false }),
});

// https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler
const crawler = new PlaywrightCrawler(
    launchContext: {
        launchOptions: {
            headless: true,
            stealth: true,
            viewport: { width:600, height:300 }
        },
    },
    async requestHandler({ request, page, enqueueLinks, log }) {
        const title = await page.title();
        log.info(`Titre: ${title} Url: ${request.loadedUrl}`);
    }
This is an abstract class that should
be extended by custom logger classes.

this._log() method must be implemented by them.
Logger | API | Crawlee
Was this page helpful?