mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.7k stars 953 forks source link

How to use logfile #560

Closed ntqr closed 4 years ago

ntqr commented 4 years ago

I'm trying to make gallery-dl output the log to a file, but the file always comes out empty. Does it output exclusively errors to the file?

mikf commented 4 years ago

It only writes logging messages, i.e. things that look like [gallery-dl][error] …, into the log file. The names of downloaded files are simply printed to Stdout. If you want to capture those, you can redirect standard output to a file (or use tee):

$ gallery-dl https://danbooru.donmai.us/posts/3737687 > output.txt
$ cat output.txt 
/tmp/danbooru/danbooru_3737687_d429f7e2bc8b040cb945404d5074b49d.jpg
ntqr commented 4 years ago

Ah makes sense, so if the log file is empty I can be sure that there were no errors right? Also, are youtube-dl errors included?

mikf commented 4 years ago

Yes, if there are no [error] (or [warning]) messages, you can be sure that everything succeeded.

youtube-dl errors are also included by default (depends on downloader.ytdl.logging), and you will always get a Failed to download … message if a file for some reason couldn't be downloaded.

ntqr commented 4 years ago

Alright thank you!