How to use the apify-shared/log.LEVELS function in apify-shared

To help you get started, we’ve selected a few apify-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apifytech / apify-js / test / autoscaling / autoscaled_pool.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
    });
github apifytech / apify-js / test / puppeteer_pool.js View on Github external
beforeEach(() => {
            log.setLevel(log.LEVELS.OFF);
            pool = new Apify.PuppeteerPool({
                launchPuppeteerOptions: {
                    headless: true,
                },
            });
        });
        afterEach(async () => {
github apifytech / apify-js / test / crawlers / puppeteer_crawler.js View on Github external
before(() => {
        prevEnvHeadless = process.env[ENV_VARS.HEADLESS];
        process.env[ENV_VARS.HEADLESS] = '1';
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
    });
github apifytech / apify-js / test / puppeteer_pool.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
        prevEnvHeadless = process.env[ENV_VARS.HEADLESS];
        process.env[ENV_VARS.HEADLESS] = '1';
    });
github apifytech / apify-js / test / autoscaling / system_status.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
    });
github apifytech / apify-js / test / request_list.js View on Github external
const sources = [
            { url: 'https://www.example.com' },
            { url: 'https://www.example.com' },
            { url: 'https://www.example.com' },
            { url: 'https://www.ex2mple.com' },
        ];

        let requestList = new Apify.RequestList({
            sources,
            keepDuplicateUrls: true,
        });

        await requestList.initialize();
        expect(requestList.length()).to.be.eql(4);

        log.setLevel(log.LEVELS.INFO);
        const logStub = sinon.stub(console, 'log');

        requestList = new Apify.RequestList({
            sources: sources.concat([
                { url: 'https://www.example.com', uniqueKey: '123' },
                { url: 'https://www.example.com', uniqueKey: '123' },
                { url: 'https://www.example.com', uniqueKey: '456' },
                { url: 'https://www.ex2mple.com', uniqueKey: '456' },
            ]),
            keepDuplicateUrls: true,
        });

        await requestList.initialize();
        expect(requestList.length()).to.be.eql(6);
        expect(logStub.called).to.be.eql(true);
        expect(logStub.getCall(0).args[0]).to.include('Check your sources\' unique keys.');
github apifytech / apify-js / test / crawlers / cheerio_crawler.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
    });
github apifytech / apify-js / test / autoscaling / autoscaled_pool.js View on Github external
before(() => {
            originalLevel = log.getLevel();
            log.setLevel(log.LEVELS.OFF);
        });
github apifytech / apify-js / test / autoscaled_pool.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
        process.env[ENV_VARS.IS_AT_HOME] = 1;
    });
github apifytech / apify-js / test / autoscaling / snapshotter.js View on Github external
before(() => {
        logLevel = log.getLevel();
        log.setLevel(log.LEVELS.ERROR);
    });