Closed vlovo closed 6 years ago
Thanks! That sounds very interesting, I will test this and make it part of debugview++
NFlog4cxx64.zip Attached you find the sample app as executeable , with log4cxx DLL for your convenience .....
I tried your test and see exactly what you mean, very interesting.
tail for win32 and notepad++ seems to have solved this the same way you suggest. https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3142
I tested your proposal, however it does not work, fs::file_size(p); is not triggering the FILE_NOTIFY_CHANGE_SIZE... I do see that right-clicking the log-file or clicking 'properties' in explorer does trigger FILE_NOTIFY_CHANGE_SIZE... looking for better ways...
please try this pre-release version https://github.com/CobaltFusion/DebugViewPP/releases/tag/v1.8.0.27
Sorry ,your are right ; I also did auto res = Win32::WaitForAnyObject(waitHandles, 10000);
instead waiting INFINITE. This might solve kind of starting problem....
I testeted v1.8.0.27 👍
works with test and real apps !
good to hear. however, I'm not really keen on the current solution, its polling the filesize every 500ms, which means it is doing more work then should be needed and the timestamps (in debugview) are at best 500ms-accurate, which is quite bad compared to the normal ~microsecond accuracy.
this is taken over from #331 I use log4cxx as a logging framework. It turns out that flushing do not operate as expected. When tailing the file in DebugView++ the FILE_NOTIFY_CHANGE_SIZE event will never be invoked. It will be invoked if you hit F5 in file explorer or if you start Baretail.exe (https://www.baremetalsoft.com/baretail/) alongside to tail the same file. I also made a test app with log4cxx and I try to forced to do an immediate flush by using the approbiate API function (appender->setImmediateFlush(true); for the record), but the behaviour do not change. So it is supposed to be a bug in log4cxx or they forget to remove API function, because the never want to flush...
So I came along with a workaround, because I noticed by quering the filesize periodically invokes the FILE_NOTIFY_CHANGE_SIZE in DebugView++. So if you add in FileReader ctor the following ( just to sketch the idea roughly..) :
it turns out tailing/autoscroll operation works again.