Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a debug option to trace bugs and issues #67

Closed
xtingray opened this issue May 1, 2020 · 3 comments
Closed

Implementing a debug option to trace bugs and issues #67

xtingray opened this issue May 1, 2020 · 3 comments

Comments

@xtingray
Copy link

xtingray commented May 1, 2020

Hi!
First, I want to thank you for making this project. It's a key component to my own project. :)

Second, a couple of suggestions:

  1. Reviewing the source code of Quazip I found that the devel comments are in Italian. I wonder if you would like to get some help to make the translation of them into English, looking for doing easier the collaboration from other coders around the world. I would like to know your thoughts about it.
  2. Tracking some issues that I have detected mostly on Windows platforms, I have noticed that there is not debugging option for the project. So, I would like to know if you would be interested in implementing a debug option to trace bugs and issues.

Just as an experiment, I made a copy of one of the Quazip classes (with a little modification of the code), just to show you how it would be an "English"/"with Debugging option" version of your project:
https://github.com/xtingray/quazip/blob/master/quazip/JlCompress.cpp

In case you like my coding proposal, please let me know.
Regards,

@stachenov
Copy link
Owner

Re: 1. Right, I was thinking of rewriting that class docs in English. Shouldn't be no problem.

Re: 2. What's a debugging option? Those numerous debugging outputs? Is there real value in them? I guess there is, but then I wouldn't start with JlCompress (it's simply a bunch of convenience functions), but rather with main classes. And I think instead of (ab)using Q_DEBUG, it's better to introduce QUAZIP_DEBUG.

Another decision is whether this should be a compile-time or a runtime (e. g. environment variable) setting. In my experience, it is very often useful for end user to be able to turn on some kind of “verbose output” to instantly see what the problem is, rather then to ask developers for help or (if the end user is a programmer) to get source code, all necessary settings and dependencies, recompile the whole thing... you get the picture.

Right now, QuaZip is in the pre-1.0 stage. Would be a nice thing to implement debugging output before v1.0 release. English docs can be done anytime.

@xtingray
Copy link
Author

xtingray commented May 1, 2020

I am sorry, it seems I didn't check the whole project source code before posting my comment. I made my suggestions based on one just file! My apologies.

Anyway, the idea of having several levels of debugging seems interesting, but you are right, maybe adding too many messages could be messy or at least, exhausting.

In my case, Quazip works like a charm in Mac and Linux systems. Nevertheless, in Windows systems, from time to time my users get "empty" or "incomplete" zip files. It seems there is some issue related to the size of the files or a memory limitation on this specific operating system. That's the reason I am trying to debug the library "line per line". Anyway, if I found the root of the problem I will let you know.

Once again, thank you for making Quazip. It's a handy project! :)

@cen1 cen1 changed the title Some suggestions Implementing a debug option to trace bugs and issues Mar 10, 2024
@cen1
Copy link
Collaborator

cen1 commented Oct 12, 2024

Adding debug all over the place is probably not the best idea, it will just increase code bloat for questionable benefit. We can add QUAZIP_DEBUG in a more targeted approach, for example, when library fails in unexpected ways and is not helpful with error codes. So if someone opens a PR with a case like "I just wasted 3 hours debugging quazip because it failed with large file on windows and adding qDebug() -here- and -here- would help identify the problem sooner", I'd gladly accept it.

@cen1 cen1 closed this as completed Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants