erickutcher / httpdownloader

HTTP(S) download manager that uses input/output completion ports (IOCP).
https://erickutcher.github.io/#HTTP_Downloader
558 stars 62 forks source link

REQ: Option to Log downloads (both successful and failed) #182

Open JNavas2 opened 2 years ago

JNavas2 commented 2 years ago

Please add an Option to Log downloads (both successful and failed), ideally with the directory of the log file. Thank you!

erickutcher commented 2 years ago

An event log for diagnostic purposes is doable. I'll give it some thought. I'm going to take a break until the new year though as I have a lot of other things I need to focus on.

JNavas2 commented 2 years ago

What I have in mind is a simple record of downloads by date, so I don't have to do it manually. An option for diagnostic logging when needed would of course be even better.

erickutcher commented 2 years ago

Right now when you select items in the list and do a Ctrl + C, it'll copy the selected items URLs. What I could do is implement a Shift + Ctrl + C to have it copy all the selected items column information (separated by tabs). That would allow it to be imported into a spreadsheet for manipulation. It would be a lot easier than a logging feature and wouldn't clutter the code.

JNavas2 commented 2 years ago

@erickutcher Thank you for the offer, but don't do that just for me, because that would still leave me doing the grunt work, and what I would like is for the computer (app) to do the grunt work, saving me effort and ensuring accuracy. As a developer myself, I consider logging an important part of a file transfer app, but regardless, it's important to my use case. That said, your app is useful enough that I will probably continue to use it without logging. Thank you again. Feel free to close this Issue.

erickutcher commented 2 years ago

I've created a build that supports logging.

32/64-bit https://github.com/erickutcher/httpdownloader/releases/download/v1.0.4.8/HTTP_Downloader_LS_32.zip https://github.com/erickutcher/httpdownloader/releases/download/v1.0.4.8/HTTP_Downloader_LS_64.zip

It's enabled through a command-line switch.

HTTP_Downloader.exe --log C:\Logs\log.txt

It's very rudimentary, but it'll at least show you the download states of a download.

JNavas2 commented 2 years ago

That is so cool, thank you, thank you, thank you!

I'm happy with this, but perhaps someday you could add a verbosity level, since all I really care about is completed downloads.

erickutcher commented 2 years ago

I thought about a verbosity option. For now though you can use a regular expression to carve out the necessary info.

In Notepad++ you can use this to in the Search > Mark... window: ^.*Download\ cleanup\ status.*$

You'll want to have the "Bookmark line" option set in that window and then afterwards go into the Search > Bookmark menu and select Remove Unmarked Lines.

JNavas2 commented 2 years ago

@erickutcher I use other tools, but thank you regardless. And Happy New Year!

smaragdus commented 2 years ago

@erickutcher

I have several questions about logging:

Regards

JNavas2 commented 2 years ago

@smaragdus

  1. Path is not hard coded. Your issue is spaces in the path. When a path has spaces, enclose it in double quotes.

  2. It's not a good idea to save anything in the program folder. By default it should be saved in an app folder within %APPDATA%, and it's good to have an option to set it manually.

smaragdus commented 2 years ago

@JNavas2

Path is not hard coded. Your issue is spaces in the path. When a path has spaces, enclose it in double quotes.

Thanks for the tip about spaces.

It's not a good idea to save anything in the program folder.

For me it is a good idea as I prefer portable mode when programs support it as it is the case with HTTP Downloader. For me running different versions with different settings (settings being isolated) is a must.

JNavas2 commented 2 years ago

@smaragdus

  1. I understand the use case, but it's a security and privacy risk. I recommend installing the program securely instead, separating settings from the program, which also makes it possible to support multiple users.
erickutcher commented 2 years ago

The LS stands for log/logging support. Only that build has the --log command-line switch working.

I made the feature a command-line only option because it's more for debugging purposes rather than a feature for all to use.

erickutcher commented 2 years ago

A new release is up. Here are the log support builds:

https://github.com/erickutcher/httpdownloader/releases/download/v1.0.4.9/HTTP_Downloader_LS_32.zip https://github.com/erickutcher/httpdownloader/releases/download/v1.0.4.9/HTTP_Downloader_LS_64.zip

There's a new command-line parameter to filter out various messages.

HTTP_Downloader.exe --log 12345 C:\Logs\log.txt

1 = Miscellaneous info 2 = Action info 3 = Connection info 4 = Warnings 5 = Errors

You can have any combination of those numbers and it'll display each of those types of messages in the log file.

For example, _HTTPDownloader.exe --log 23 C:\Logs\log.txt will display actions that you perform (adding, removing, updating, etc.) as well as when the download starts, pauses, and stops.

JNavas2 commented 2 years ago

Thank you, I really appreciate your hard work! I mostly just care about completed downloads, so I'm going with "3".