notepadpp-CodeStats icon indicating copy to clipboard operation
notepadpp-CodeStats copied to clipboard

Add SAVE_LOG_IN_TEMP_INSTEAD_OF_PLUGIN_DIR preprocessor definition ...

Open pinodev opened this issue 5 years ago • 2 comments

... 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:

  • https://github.com/p0358/notepadpp-CodeStats/issues/8
  • https://github.com/p0358/notepadpp-CodeStats/issues/8#issuecomment-486880337

pinodev avatar Apr 29 '19 13:04 pinodev

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.

p0358 avatar May 06 '19 16:05 p0358

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.

pinodev avatar May 10 '19 19:05 pinodev