p0358 / notepadpp-CodeStats

Notepad++ plugin for Code::Stats (https://codestats.net)
Other
38 stars 21 forks source link

Add SAVE_LOG_IN_TEMP_INSTEAD_OF_PLUGIN_DIR preprocessor definition ... #9

Open pinodev opened 5 years ago

pinodev commented 5 years ago

... and code, disabled by default in order to remain backward compatible for now... # legacy-bckcompat-isofunc-addonly-preproc-toggle-hotfix # prepared-hotfix-toggle

For the motivations behind this changeset, see:

p0358 commented 5 years ago

Can you elaborate the benefits of this change? I think that as long as the logger tries to write to the same file, the issue with errors may persist. As for excessive disk usage (which will too be fixed in next version in case of unrecognized extension, and will only happen in debug mode), the log file is deleted on each Notepad++ start in order to save space, so this wouldn't change anything. Solution I am currently implementing will simply show one message box with error in a session, and then will ignore the other errors to let user continue their work with no interruptions.

pinodev commented 5 years ago

Well, the work is not really over: this should probably a configuration option instead of a compiler switch.

The advantage of putting the log file in TEMP, is that it reduces the strain on the AppData directory. In my case, there were really many many MANY writes in the log file. And each of this operations is opening the file, writing to it and closing it.

I am fairly nomadic, and I use Notepad++ in a portable manner; in particular, my AppData/Notepad++ directory is synchronized.

Having the CodeStats plugin writing at this high rate in a file that is being monitored and synchronised caused a problem I've never had before.

I admit this is an edge case, but if you think of it, the log file is not relevant for the functioning of the application anyway, it's a little bit of information and a lot of noise. For the greater good, I had to get rid of it, and move it to the TEMP folder.

It was a easy and effective fix.