hellock / icrawler

A multi-thread crawler framework with many builtin image crawlers provided.
http://icrawler.readthedocs.io/en/latest/
MIT License
857 stars 174 forks source link

Can't turn INFO logs off #111

Open harbachonak opened 1 year ago

harbachonak commented 1 year ago

Hey!

I'm using GoogleImageCrawler and trying to turn the INFO logs off, so I see only warning and errors in cmd. Am I doing something wrong? Cause INFO logs are still showed. Thanks!

   google_crawler = GoogleImageCrawler(
        feeder_threads=1,
        parser_threads=1,
        downloader_threads=4,
        storage={"root_dir": "pic/"},
    )
    google_crawler_motiv.set_logger(log_level=logging.WARNING) 

    google_crawler .crawl(
        keyword=request,
        max_num=num,
        min_size=(200, 200),
        max_size=None,
        file_idx_offset="auto",
    )
VediYD commented 1 year ago

@harbachonak Did you find a solution for this? I am trying to do the same.

VediYD commented 1 year ago

@harbachonak you can set the log level when creating the object. Something like this,

from icrawler.builtin import GoogleImageCrawler

google_crawler = GoogleImageCrawler(
    storage={
        'root_dir': '/images'
    },
    log_level=50,
)
google_crawler.crawl(keyword='cat', max_num=10)

This worked on

icrawler                     0.6.7

using python3.10.

Hope this helps.