<div dir="ltr">Hi,<div>I have recently changed backend of therion logging in this commit <a href="https://github.com/therion/therion/commit/5b60074328476b860ea35d48da0d6add4892ea12" target="_blank">https://github.com/therion/therion/commit/5b60074328476b860ea35d48da0d6add4892ea12</a>, so that is maybe when it stopped working. But I see two reasons why this bug happens:</div><div>1. Original implementation did not explicitly flush the output stream, but it apparently relied on some implicit flushing, which the current implementation does not do. Fix would be to add an explicit flush.</div><div>2. Thlogfile output should get closed in its destructor, which would properly write all the data, but it is possibly never destructed. Solution would be to reimplement thlogfile as a proper singleton, not just a global variable.</div><div><br></div><div>I can prepare a quick fix with 1., but 2. should also get fixed in the future.</div><div><br></div><div>Matěj</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">so 6. 1. 2024 v 0:18 odesílatel Bruce Mutton <<a href="mailto:bruce@tomo.co.nz" target="_blank">bruce@tomo.co.nz</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div lang="EN-NZ"><div><p class="MsoNormal">Recently I’ve noticed some of my therion log files are truncated.  They end prematurely.<u></u><u></u></p><p class="MsoNormal">Only happens with some thconfig files and while the location of the truncation is often consistent within each file, it can change with subsequent compile runs as well.<u></u><u></u></p><p class="MsoNormal">Noticed this while trying to debug a presumably unrelated issue.<u></u><u></u></p><p class="MsoNormal">Some examples below.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any insights as to why this might happen?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Bruce<u></u><u></u></p><p class="MsoNormal">on Windows 10 Home v 22H2<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span><img width="1303" height="147" style="width:13.5694in;height:1.5277in" id="m_-3134700269204534064m_1744361621001740033m_6875891729008044170Picture_x0020_1" src="cid:ii_18ce829298d692e332"></span><u></u><u></u></p><p class="MsoNormal"><span><img width="1043" height="73" style="width:10.8611in;height:0.7569in" id="m_-3134700269204534064m_1744361621001740033m_6875891729008044170Picture_x0020_2" src="cid:ii_18ce829298d855d353"></span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Another example.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">therion 6.2.0 (2023-12-21)<u></u><u></u></p><p class="MsoNormal">  - using Proj 9.3.0, compiled against 9.3.0<u></u><u></u></p><p class="MsoNormal">initialization file: C:\Program Files\Therion/therion.ini<u></u><u></u></p><p class="MsoNormal">reading ... done<u></u><u></u></p><p class="MsoNormal">configuration file: thconfig-DwarfsDoor.thc<u></u><u></u></p><p class="MsoNormal">reading ... done<u></u><u></u></p><p class="MsoNormal">reading source files ... done<u></u><u></u></p><p class="MsoNormal">preprocessing database ... done<u></u><u></u></p><p class="MsoNormal">output coordinate system: EPSG:2193<u></u><u></u></p><p class="MsoNormal">meridian convergence (deg): -0.0685<u></u><u></u></p><p class="MsoNormal">geomag declinations (deg):<u></u><u></u></p><p class="MsoNormal">  1992.1.1  21.3626<u></u><u></u></p><p class="MsoNormal">  1993.1.1  21.3859<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">…and the log proceeds normally until a line is truncated mid-sentence…<u></u><u></u></p><p class="MsoNormal">0.27%    0.4m  146.4m  30    0.2m    0.0m    0.4m [sn45.31@118.MiddleEarth - 118.64 - 118.63 - 118.62 - 118.61 - 118.60 - 118.56 - 118.66 - 78.12 = <a href="mailto:78.12@78.MiddleEarth" target="_blank">78.12@78.MiddleEarth</a> - 78.11 - 78.10 - 78.9 - 78.8 - 78.7 - 78.6 - 78.5 - 78.4 - 78.3 - 78.2 - 78.1 - 77.12 = <a href="mailto:77.12@77.MiddleEarth" target="_blank">77.12@77.MiddleEarth</a> - 77.11                                                                                                         <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span><img border="0" width="1778" height="193" style="width:18.5208in;height:2.0069in" id="m_-3134700269204534064m_1744361621001740033m_6875891729008044170Picture_x0020_3" src="cid:ii_18ce829298da18c371"></span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In this case some loops are missing and scrap distortions and CRS transformations are missing.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">But the log file truncation can happen anywhere, as in the screenshot below…<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span><img border="0" width="725" height="217" style="width:7.5555in;height:2.2569in" id="m_-3134700269204534064m_1744361621001740033m_6875891729008044170Picture_x0020_4" src="cid:ii_18ce829298d1f3c04f4"></span><u></u><u></u></p></div></div>_______________________________________________<br>
Therion mailing list<br>
<a href="mailto:Therion@speleo.sk" target="_blank">Therion@speleo.sk</a><br>
<a href="https://mailman.speleo.sk/listinfo/therion" rel="noreferrer" target="_blank">https://mailman.speleo.sk/listinfo/therion</a><br>
</div></blockquote></div></div>