diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-23 21:11:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-23 21:11:56 +0000 |
commit | 37f77685a693b9cad0901d2d5b918805c57580b2 (patch) | |
tree | b4e0e76c777c09fdda857e03f122c7968799764c /Master | |
parent | 5d66b745f10a2f0bfd2c977c8996474805dbc3b2 (diff) |
texlogsieve (23apr22)
git-svn-id: svn://tug.org/texlive/trunk@63115 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/man/man1/texlogsieve.1 | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf | bin | 41517 -> 40198 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/texlogsieve/README.md | 16 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf | bin | 58593 -> 59004 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex | 19 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/texlogsieve/texlogsieve | 128 |
6 files changed, 114 insertions, 51 deletions
diff --git a/Master/texmf-dist/doc/man/man1/texlogsieve.1 b/Master/texmf-dist/doc/man/man1/texlogsieve.1 index f6d47eef13f..0e459206471 100644 --- a/Master/texmf-dist/doc/man/man1/texlogsieve.1 +++ b/Master/texmf-dist/doc/man/man1/texlogsieve.1 @@ -1,4 +1,4 @@ -.TH TEXLOGSIEVE "1" "March 2022" "texlogsieve 1.1.2" "User Commands" +.TH TEXLOGSIEVE "1" "April 2022" "texlogsieve 1.1.3" "User Commands" .SH NAME diff --git a/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf b/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf Binary files differindex 1a71327d76d..f3afbdf6d3f 100644 --- a/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf diff --git a/Master/texmf-dist/doc/support/texlogsieve/README.md b/Master/texmf-dist/doc/support/texlogsieve/README.md index e7e92339978..fd13e3de2bb 100644 --- a/Master/texmf-dist/doc/support/texlogsieve/README.md +++ b/Master/texmf-dist/doc/support/texlogsieve/README.md @@ -3,8 +3,13 @@ `texlogsieve` reads a LaTeX log file (or the standard input if no file is specified), filters out less relevant messages, and displays a summary report. It is a `texlua` script, similar in spirit to tools such as -`texfot`, `texloganalyser`, `rubber-info`, `textlog_extract`, -`texlogparser`, and others. Highlights: +[`texfot`](https://ctan.org/pkg/texfot), +[`texloganalyser`](https://ctan.org/pkg/texloganalyser), +[`rubber-info`](https://gitlab.com/latex-rubber/rubber), +[`textlog_extract`](https://ctan.org/pkg/texlog-extract), +[`texlogparser`](https://github.com/reitzig/texlogparser), +[`texlogfilter`](https://gricad-gitlab.univ-grenoble-alpes.fr/labbeju/latex-packages), +and others. Highlights: * Two reports: the most important messages from the log file followed by a summary of repeated messages, undefined references etc.; @@ -16,9 +21,7 @@ report. It is a `texlua` script, similar in spirit to tools such as * Several options to control which messages should be filtered out; -* No messages are accidentally removed; - -* The summary report is currently simple, but useful. +* No messages are accidentally removed. `texlogsieve` **must** be run from the same directory as `[pdf|lua|xe]latex`, because it searches for the files used during compilation (packages loaded @@ -38,7 +41,8 @@ or texlogsieve myfile.log ``` -and be satisfied with the result. +and be satisfied with the result (still, you should check the "Tips" +section of the documentation). Since it needs to know what messages to expect, `texlogsieve` is currently geared towards LaTeX; I have no idea how it would work with diff --git a/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf b/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf Binary files differindex b8fcee8d52f..4bac5034a6a 100644 --- a/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf +++ b/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf diff --git a/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex b/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex index 38e179285d1..9d7d2d751bc 100644 --- a/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex +++ b/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex @@ -75,12 +75,14 @@ \changes{1.1.0}{2022/03/04}{Do not lose messages if the file is truncated} \changes{1.1.1}{2022/03/05}{Fix error in variable scope} \changes{1.1.2}{2022/03/14}{Fix bug unwrapping lines starting with ``]''} +\changes{1.1.3}{2022/04/22}{Be more careful with continuation lines in error + msgs} \begin{document} \title{\textsf{texlogsieve}:\thanks{This document -corresponds to \textsf{texlogsieve}~1.1.2, -dated~2022-03-14.}\\[.3\baselineskip] +corresponds to \textsf{texlogsieve}~1.1.3, +dated~2022-04-22.}\\[.3\baselineskip] {\normalsize(yet another program to)\\[-.6\baselineskip]} {\large filter and summarize \LaTeX\ log files} } @@ -108,8 +110,7 @@ a summary report. Highlights: wrapping and does a much better job at that than existing tools; \item Multiline messages are treated as a single entity; \item Several options to control which messages should be filtered out; - \item No messages are accidentally removed; - \item The summary report is currently simple, but useful. + \item No messages are accidentally removed. \end{itemize} \end{abstract} @@ -122,9 +123,13 @@ character'', ``undefined reference'', and others become buried among lots of less relevant messages. This program filters out such less relevant messages and outputs the rest, together with a final summary for the specially important ones. It is a \texttt{texlua} script, similar in -spirit to tools such as \texttt{texfot}, \texttt{texloganalyser}, -\texttt{rubber-info}, \texttt{textlog\_extract}, \texttt{texlogparser}, -and others. +spirit to tools such as \href{https://ctan.org/pkg/texfot}{\texttt{texfot}}, +\href{https://ctan.org/pkg/texloganalyser}{\texttt{texloganalyser}}, +\href{https://gitlab.com/latex-rubber/rubber}{\texttt{rubber-info}}, +\href{https://ctan.org/pkg/texlog-extract}{\texttt{textlog\_extract}}, +\href{https://github.com/reitzig/texlogparser}{\texttt{texlogparser}}, +\href{https://gricad-gitlab.univ-grenoble-alpes.fr/labbeju/latex-packages} +{\texttt{texlogfilter}}, and others. Note that it does not try to do anything smart about error messages (but it shows a warning in the summary if one is detected); if there diff --git a/Master/texmf-dist/scripts/texlogsieve/texlogsieve b/Master/texmf-dist/scripts/texlogsieve/texlogsieve index d1917ff99ea..b93431aa78e 100755 --- a/Master/texmf-dist/scripts/texlogsieve/texlogsieve +++ b/Master/texmf-dist/scripts/texlogsieve/texlogsieve @@ -553,7 +553,7 @@ line as the under/overfull box message (both are \message's). The offending text, if any, always starts at the beginning of a line and ends at the end of a line. -About the description: https://tex.stackexchange.com/a/367589/217608 +About the description: https://tex.stackexchange.com/a/367589 This all means that handling these messages from a pipe is different than from the log file, because in the log file you know there will @@ -1002,7 +1002,7 @@ Options: --version if vars.version then - print("texlogsieve 1.1.2") + print("texlogsieve 1.1.3") print("Copyright (C) 2021, 2022 Nelson Lago <lago@ime.usp.br>") print("License GPLv3+: GNU GPL version 3 or later " .. "<https://gnu.org/licenses/gpl.html>.") @@ -1887,66 +1887,116 @@ errorHandler.patterns = { 'You already have nine', } +function errorHandler:isErrorLine(line) + local _, last = string.find(line, '^! ') + if not last then + _, last = string.find(line, '^' .. filepat .. ':%d+: ') + end + + return last +end + +function errorHandler:isRunawayLine(line) + local _, last = string.find(line, '^Runaway argument%?') + return last +end + function errorHandler:canDoit(position) if position == nil then position = 0 end local line = Lines:get(position) if line == nil then return false, {} end -- This error does not start with "! " or "file:line: " - local _, last = string.find(line, '^Runaway argument%?') - if last then return true, {} end + local last = self:isRunawayLine(line) + if last then return true, {numLines = 1} end - -- If the line does not start with "! " or "file:line: ", get out. - _, last = string.find(line, '^! ') - if not last then - _, last = string.find(line, '^' .. filepat .. ':%d+: ') - if not last then return false, {} end - end - - -- OK, this might be an error, but we need to be sure; - -- let's look for a known error message - local candidateText = string.sub(line, last +1) - for _, pat in ipairs(self.patterns) do - _, last = string.find(candidateText, pat) - if last ~= nil then break end - end - if last then return true, {} end + last = self:isErrorLine(line) + if not last then return false, {} end - -- Not a known error message; let's look for a line number - -- or "Type H <return> for immediate help" + -- Looks like an error; Let's look ahead to identify the other + -- lines that are part of the error message. We do not want to + -- look too much ahead, so we just scan the current buffer. position = position +1 - local found = false - while not found and position < Lines:numLines() do - local first = string.find(Lines:get(position), '^l%.%d+ ') - if first then found = true end + local lastline = nil + while position < Lines:numLines() do + -- if there is a second error, don't look further ahead + if self:isErrorLine(Lines:get(position)) + or self:isRunawayLine(Lines:get(position)) + + then break end + + if string.find(Lines:get(position), '^l%.%d+ ') then + local length = string.len(Lines:get(position)) + if string.find(Lines:get(position +1), + "^" .. string.rep(" ", length)) + then + lastline = position +1 -- the following line is the last + else + -- the following line is empty, so it was skipped + -- when reading the file + lastline = position + end + end - first = string.find(Lines:get(position), - '^Type%s+H %<return%>%s+for immediate help%.') - if first then found = true end + if string.find(Lines:get(position), + '^Type%s+H %<return%>%s+for immediate help%.') then + lastline = position + end position = position +1 end - if found then - return true, {} + if lastline then + -- position starts at zero, so numlines needs +1 + return true, {numLines = lastline +1} else - return false, {} + -- This looks like an error, but there is no "l.NUM" line following + -- it, so it is probably a false positive. Still, let's check for + -- some known error messages. + local candidateText = string.sub(line, last +1) + for _, pat in ipairs(self.patterns) do + _, last = string.find(candidateText, pat) + if last ~= nil then return true, {numLines = 1} end + end end + + return false, {} -- this was really a false positive end -function errorHandler:doit() +function errorHandler:handleFirstLine() local myTurn, data = self:canDoit() if not myTurn then return false end flushUnrecognizedMessages() - local msg = self:newMessage() - msg.content = Lines.current - msg.severity = UNKNOWN - dispatch(msg) + ERRORS_DETECTED = true + self.message = self:newMessage() + self.message.severity = UNKNOWN + self.message.content = Lines.current Lines:handledChars() - ERRORS_DETECTED = true + + self.processed = 1 + self.numLines = data.numLines + self.doit = self.handleLines + nextHandler = self + + return true +end + +errorHandler.doit = errorHandler.handleFirstLine + +function errorHandler:handleLines() + if self.processed >= self.numLines then + self.doit = self.handleFirstLine + dispatch(self.message) + else + self.message.content = self.message.content .. '\n' .. Lines.current + Lines:handledChars() + self.processed = self.processed +1 + nextHandler = self + end + return true end @@ -2687,6 +2737,10 @@ beginningOfLineDebugStringsHandler.patterns = { '^%-%- Using %S+ output%.', '^%-%- Verifying Times compatible math font%.', '^%-%- %S+ loaded, OK%.', + + -- From libertinust1math.sty + '^amsthm loaded', + '^amsthm NOT loaded', } |