tex_log_parser 1.0.0.pre.15 → 1.0.0.pre.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +98 -6
- data/lib/log_parser/log_parser.rb +1 -1
- data/lib/log_parser/logger.rb +6 -2
- data/lib/tex_log_parser/patterns/highlighted_messages.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a250fc41646ce2605eac36e8ce5ad22a1767c5de0dc824683a2a8a497d2b173c
|
4
|
+
data.tar.gz: d3df0c06d2280d808a9f9cb3db1eb73d673a8183bb826abe0ef1ad8df4ae0fd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9b0f10261169bea1cdd0e0ada59cfb92dec26227fd1dca371d7e530f4078b9a700c3781cd038fd47f2a71a7d80c605b7ee64ba2c8cdfd12746a52f2230e5341
|
7
|
+
data.tar.gz: 627ea1f3f32ba584e9c314d198a73ff71c5d2575e799056e88b815e29698a1d459428f3bfd5a91635639592281227b210d934ee12a68aced29247ba1690d828d
|
data/README.md
CHANGED
@@ -4,17 +4,109 @@
|
|
4
4
|
[](http://www.rubydoc.info/gems/tex_log_parser/1.0.0) **˙**
|
5
5
|
[](https://codeclimate.com/github/reitzig/texlogparser/maintainability)
|
6
6
|
[](https://codeclimate.com/github/reitzig/texlogparser/test_coverage) **˙**
|
7
|
-
[](https://circleci.com/gh/reitzig/texlogparser)
|
7
|
+
[](https://circleci.com/gh/reitzig/workflows/texlogparser/tree/master)
|
8
8
|
[](http://inch-ci.org/github/reitzig/texlogparser)
|
9
9
|
|
10
|
-
|
10
|
+
This small Ruby gem eases many pains around digesting logs from (La)TeX engines.
|
11
|
+
Used as a command-line program or library, it converts (La)TeX logs into human-
|
12
|
+
or machine-readable forms.
|
13
|
+
|
14
|
+
_Disclaimer:_ Due to the nature of (La)TeX logs, parsing is inherently heuristic.
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
On any system with working Ruby (≥ 2.3), installation is as simple as this:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
[sudo] gem install tex_log_parser
|
22
|
+
```
|
23
|
+
|
24
|
+
The usual options and, later, update mechanisms of Rubygems apply;
|
25
|
+
please refer to their documentation for details.
|
11
26
|
|
12
27
|
## Usage
|
13
28
|
|
14
|
-
|
15
|
-
|
29
|
+
There are two ways to parse logs: with the command-line program and via the underlying Ruby API.
|
30
|
+
|
31
|
+
### Command-line Interface
|
32
|
+
|
33
|
+
By default, `texlogparser` reads from stdin and writes to stdout. That is, you can use it like so:
|
34
|
+
|
35
|
+
```bash
|
36
|
+
pdflatex -interaction=nonstopmode example.tex | texlogparser
|
37
|
+
```
|
38
|
+
|
39
|
+
This adds so little runtime overhead that there are few reasons _not_ to use it.
|
40
|
+
Note that the original log file will still be written to `example.log`,
|
41
|
+
so no information is lost.
|
42
|
+
|
43
|
+
You can also read from and/or write to files:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
texlogparser -i example.log # From file, to stdout
|
47
|
+
texlogparser -i example.log -o example.simple.log # From and to file
|
48
|
+
cat example.log | texlogparser -o example.simple.log # From stdin, to file
|
49
|
+
```
|
50
|
+
|
51
|
+
If you want to use the output programmatically, you may want to add option `-f json`.
|
52
|
+
It does just what it sounds like.
|
53
|
+
|
54
|
+
|
55
|
+
### Ruby API
|
56
|
+
|
57
|
+
### Recommendations
|
58
|
+
|
59
|
+
* Use `_latex` option `-file-line-error` to get higher accuracy regarding source files and lines.
|
60
|
+
* [Increase the maximum line length](https://tex.stackexchange.com/a/52994/3213) as much as possible
|
61
|
+
to improve overall efficacy. Bad linebreaks are
|
62
|
+
[bad](https://github.com/reitzig/texlogparser/search?utf8=%E2%9C%93&q=BROKEN_BY_LINEBREAKS&type=).
|
63
|
+
* Avoid parentheses and whitespace in file paths.
|
16
64
|
|
17
65
|
## Contributing
|
18
66
|
|
19
|
-
|
20
|
-
|
67
|
+
For bug reports and feature requests, the usual rules apply: search for
|
68
|
+
[existing issues](https://github.com/reitzig/texlogparser/issues);
|
69
|
+
join the discussion or
|
70
|
+
[create a new one](https://github.com/reitzig/texlogparser/issues/new);
|
71
|
+
be specific and nice; expect nothing.
|
72
|
+
|
73
|
+
That aside, there are two groups of experts whose help would be much appreciated:
|
74
|
+
(La)TeX gourmets and Ruby developers.
|
75
|
+
|
76
|
+
### TeXians
|
77
|
+
|
78
|
+
Please report any logs that get parsed wrong, be it because whole messages are not found,
|
79
|
+
or because not all details are correctly extracted.
|
80
|
+
|
81
|
+
Reports that provide the following information will be the most useful:
|
82
|
+
|
83
|
+
1. Full failing log of a minimal example (ideally with source document).
|
84
|
+
2. The engine(s) you use, e.g. `pdflatex`, `xelatex`, or `lualatex`.
|
85
|
+
3. Expected number of error, warning, and info messages (the latter optional).
|
86
|
+
4. Expected message with
|
87
|
+
* log line numbers (where the message starts and ends),
|
88
|
+
* level of the message (error, warning, or info), and
|
89
|
+
* which source file (and lines) it references.
|
90
|
+
5. _Advanced_: In case of wrong source files, run `texlogparser -d` on the log
|
91
|
+
and note on which lines it changes file scopes in wrong ways.
|
92
|
+
|
93
|
+
If you _also_ know a little Ruby, please consider translating those data into
|
94
|
+
[a (failing) test](https://github.com/reitzig/texlogparser/blob/master/test/test_texlogparser.rb)
|
95
|
+
and open a pull request.
|
96
|
+
|
97
|
+
Some preemptive notes:
|
98
|
+
* Issues around messages below warning level have low priority.
|
99
|
+
* Problems caused by inopportune linebreaks are _probably_ out of scope.
|
100
|
+
|
101
|
+
**Bonus:** Convince as many package maintainers to use the same standardized, robust way of writing to the log.
|
102
|
+
|
103
|
+
### Rubyists
|
104
|
+
|
105
|
+
Any feedback about the code quality and usefulness of the documentation would be
|
106
|
+
very appreciated. Particular areas of interest include:
|
107
|
+
|
108
|
+
* Is the API designed in useful ways?
|
109
|
+
* Does the documentation cover all your questions?
|
110
|
+
* Is the Gem structured properly?
|
111
|
+
* What can be improved to encourage code contributions?
|
112
|
+
* Does the CLI script have problems on any platform?
|
data/lib/log_parser/logger.rb
CHANGED
@@ -10,7 +10,7 @@ module LogParser
|
|
10
10
|
# @param [true,false] flag
|
11
11
|
# @return [void]
|
12
12
|
def debug=(flag)
|
13
|
-
|
13
|
+
self.debugging = flag
|
14
14
|
end
|
15
15
|
|
16
16
|
# Indicates whether we are debugging.
|
@@ -18,7 +18,7 @@ module LogParser
|
|
18
18
|
# @return [true,false]
|
19
19
|
# `true` if we are in debugging mode, `false` otherwise.
|
20
20
|
def debug?
|
21
|
-
|
21
|
+
debugging || !ENV['DEBUG'].nil?
|
22
22
|
end
|
23
23
|
|
24
24
|
# Logs the given message to STDOUT if `debug?` is true.
|
@@ -28,6 +28,10 @@ module LogParser
|
|
28
28
|
def debug(message)
|
29
29
|
puts message if debug?
|
30
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
attr_accessor :debugging
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tex_log_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.
|
4
|
+
version: 1.0.0.pre.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Reitzig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-markup
|