diff --git a/APLSource/LogDog/CRLF.aplf b/APLSource/LogDog/CRLF.aplf new file mode 100644 index 0000000..1bed171 --- /dev/null +++ b/APLSource/LogDog/CRLF.aplf @@ -0,0 +1,2 @@ + r←CRLF + r←⎕UCS 13 10 diff --git a/APLSource/LogDog/CreateViewer.aplf b/APLSource/LogDog/CreateViewer.aplf index 3bb799c..ee11858 100644 --- a/APLSource/LogDog/CreateViewer.aplf +++ b/APLSource/LogDog/CreateViewer.aplf @@ -20,7 +20,6 @@ n.Viewer.Size[0]-←4+↑n.Statusbar.Size n.SB_Info.Text←'' - n.Viewer.Visible←1 n.Viewer.onKeyPress←'OnKeyPressInViewer' n.∆form.Caption←GetCaption n n.∆form.CursorObj←cursorWas diff --git a/APLSource/LogDog/Find.aplf b/APLSource/LogDog/Find.aplf index 5c3f3e4..9b0fcd9 100644 --- a/APLSource/LogDog/Find.aplf +++ b/APLSource/LogDog/Find.aplf @@ -2,7 +2,7 @@ n2←CreateFindGUI n ⎕NQ n2.SearchFor'GotFocus' res←⎕DQ n2.∆form - :If 0∊⍴res + :If 0=≢res :OrIf n2.Cancel≡↑res :Trap 6 ⎕EX'n2.∆form.n' diff --git a/APLSource/LogDog/History.aplf b/APLSource/LogDog/History.aplf index 60d3218..a164eec 100644 --- a/APLSource/LogDog/History.aplf +++ b/APLSource/LogDog/History.aplf @@ -1,4 +1,10 @@ History +⍝ * 3.0.1 ⋄ 2021-07-22 +⍝ * Bug fixes +⍝ * Under some circumstances LogDog crashed on its first attempt to refresh the GUI +⍝ * Due to Dyalog bug <01896> sometimes Linefeed got injected into the GUI. Circumvention +⍝ implemented but at the expense of additonal memory usage. +⍝ * When the size of a log file was reduced by some means, or re-created, then LogDog crashed. ⍝ * 3.0.0 ⋄ 2021-07-12 ⍝ * Bug fixes ⍝ * Log files from Unix were not shown correctly since LogDog expected CRLF (Windows) diff --git a/APLSource/LogDog/InitialReadOfLogfile.aplf b/APLSource/LogDog/InitialReadOfLogfile.aplf index 5450b7e..28eb100 100644 --- a/APLSource/LogDog/InitialReadOfLogfile.aplf +++ b/APLSource/LogDog/InitialReadOfLogfile.aplf @@ -1,4 +1,4 @@ - n←InitialReadOfLogfile n;data;noOf;startByte;bytes + n←InitialReadOfLogfile n;noOf;startByte;bytes;data ⍝ We read blocks of `blockSize` or less characters from the end of the file ⍝ and then make them records. ⍝ We collect those records until we reach n.∆Parms.NoOfRecords records or @@ -23,14 +23,19 @@ :If 0=≢bytes←(⎕NREAD n.∆tno,82,(n.∆Parms.BlockSize⌊n.∆FileSize),startByte) :Leave :EndIf - noOf+←+/LF⍷bytes - data←bytes,data + noOf+←bytes+.=LF startByte←0⌈startByte-≢bytes + data←bytes,data + bytes←'' :Until (n.∆Parms.NoOfRecords≤noOf)∨(≢data)=n.∆FileSize - n.∆ReadLogFrom←⍴data - data←LF ##.APLTreeUtils2.Split data - data←(-0=≢↑¯1↑data)↓data - data←(-(⍴data)⌊n.∆Parms.NoOfRecords)↑data + n.∆NextStartByte←≢bytes + data←CRLF ##.APLTreeUtils2.Split data + data←¯1↓⍣(0=≢(¯1+≢data)⊃data)⊣data ⍝ Drop last record if empty + :If n.∆Parms.NoOfRecords<≢data + data←(-n.∆Parms.NoOfRecords)↑data ⍝ Cut it back + :EndIf + n.Viewer.Visible←0 n.Viewer.Text←data n.Viewer.SelText←(2⍴1+⍴data),¨1 + n.Viewer.Visible←1 ⍝Done diff --git a/APLSource/LogDog/OnFindNext.aplf b/APLSource/LogDog/OnFindNext.aplf index 63f7b10..1c0e122 100644 --- a/APLSource/LogDog/OnFindNext.aplf +++ b/APLSource/LogDog/OnFindNext.aplf @@ -4,7 +4,7 @@ hit←,1↑n.∆Parms.Hits n.Viewer.SelText←Highlight hit n.∆Parms.Hits←1↓n.∆Parms.Hits - 0∊⍴n.∆Parms.Hits:⍬⊣n.SB_Info.Text←{''}n.FindNext.Active←0 + 0=≢n.∆Parms.Hits:⍬⊣n.SB_Info.Text←{''}n.FindNext.Active←0 n.SB_Info.Text←(⍕↑⍴n.∆Parms.Hits),' hit',((1<↑⍴n.∆Parms.Hits)/'s'),' remaining.' ⍬ } diff --git a/APLSource/LogDog/OnOkInSearchForm.aplf b/APLSource/LogDog/OnOkInSearchForm.aplf index a2705db..53fbfb4 100644 --- a/APLSource/LogDog/OnOkInSearchForm.aplf +++ b/APLSource/LogDog/OnOkInSearchForm.aplf @@ -2,7 +2,7 @@ rf←↑msg n2←Get_n rf n←Get_n n2.∆form.## - :If ~0∊⍴n2.SearchFor.Text + :If 0≠≢n2.SearchFor.Text {}{2 ⎕NQ ⍵.Freeze'Select'}⍣(↑0=n.Freeze.State)⊣n n.∆Parms.SearchText←n2.SearchFor.Text n.∆Parms.CaseSensitive←n2.CaseSensitive.State diff --git a/APLSource/LogDog/OpenLogFile.aplf b/APLSource/LogDog/OpenLogFile.aplf index f93765e..9993159 100644 --- a/APLSource/LogDog/OpenLogFile.aplf +++ b/APLSource/LogDog/OpenLogFile.aplf @@ -7,7 +7,7 @@ :Trap 19 n.∆tno←n.∆filename ⎕NTIE 0 64 n.∆LastFileSize←⍬ - n.∆ReadLogFrom←0 + n.∆NextStartByte←0 :Else ⎕DL 1 tryFlag+←1 diff --git a/APLSource/LogDog/ReadLastRecords.aplf b/APLSource/LogDog/ReadLastRecords.aplf index b5becf2..87127ba 100644 --- a/APLSource/LogDog/ReadLastRecords.aplf +++ b/APLSource/LogDog/ReadLastRecords.aplf @@ -1,4 +1,4 @@ - upToDate←ReadLastRecords n;size;fileSize;maxNumberOfBytes;noOfBytes;noOfRecords;maxNoOfRecords;bytes + isUpToDate←ReadLastRecords n;size;fileSize;maxNumberOfBytes;noOfBytes;noOfRecords;maxNoOfRecords;bytes ⍝ We read all data that has been written since the last read operation. ⍝ In case the max number of records is exceeded we reduce the number of ⍝ records shown plus 15%. @@ -9,27 +9,33 @@ fileSize←⎕NSIZE n.∆tno :If fileSize≡n.∆LastFileSize n.∆form.OnTop←0 - upToDate←1 + isUpToDate←1 + :ElseIf fileSize |Kai Jaeger | 2014-04-27 | -|Last update | 2021-07-12 | \ No newline at end of file +|Last update | 2021-07-22 | \ No newline at end of file diff --git a/LogDog.iss b/LogDog.iss index ba50196..e6a7d61 100644 --- a/LogDog.iss +++ b/LogDog.iss @@ -1,6 +1,6 @@ ; This script is best executed by LogDog's "Make" utility. -#define MyAppVersion "3.0.0+58" +#define MyAppVersion "3.0.1+62" #define MyAppName "LogDog" #define MyAppPublisher "APL Team Ltd" #define MyAppURL "https://github.com/aplteam/LogDog" diff --git a/project.dws b/project.dws index a238f6e..43db60b 100644 Binary files a/project.dws and b/project.dws differ