logviewer 2.2.0 → 2.3.2
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 +3 -3
- data/lib/logviewer/version.rb +1 -1
- data/lib/logviewer.rb +21 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf4cbd59538ebd5cea3996ab440834261bbf8476e4445b9a99899b71bb44352d
|
4
|
+
data.tar.gz: 89ed86e379919ee274bf0cd03628e02a29a8fa57f407af3a64da6b0f04b8db1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc216b0e8fe6c848e6b91c408c32a631770b524cd8f8f0791c8a55da7f4a504106d36170b85f25f392845230f33d040807410db8e34bc5615043b615135e61d5
|
7
|
+
data.tar.gz: 1b23a018f31fcbc40a00c940e6c86a5b4a1233dde1de7c66f76f05107ad0bfdbcd13b8f7983d5cae5bdff7cbb857e8b341039c52b8a44217d7a0cc482102ecd5
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ A Ruby gem that converts NDJSON log files into a readable HTML format for easy v
|
|
6
6
|
|
7
7
|
- Converts NDJSON log files to HTML tables
|
8
8
|
- Filters logs by minimum level (trace, debug, info, notice, warning, error, critical)
|
9
|
-
- Displays key fields: date, level, tag, file, function, and text
|
9
|
+
- Displays key fields: date, level, tag, file, line, function, and text
|
10
10
|
- Human-readable timestamp formatting (MM/DD HH:MM:SS)
|
11
11
|
- Simplified file paths (shows only filename, not full path)
|
12
12
|
- Color-coded log levels for easy identification
|
@@ -105,7 +105,7 @@ Example log entry:
|
|
105
105
|
|
106
106
|
The generated HTML file will be saved in `/tmp/` with a timestamp and automatically opened in your browser. The HTML includes:
|
107
107
|
|
108
|
-
- A wide, responsive table layout (
|
108
|
+
- A wide, responsive table layout (2000px max width) with columns in order: date, level, tag, file, line, function, text
|
109
109
|
- Interactive log level filtering dropdown for dynamic filtering in the browser
|
110
110
|
- Multi-select tag filter to show only specific subsystem/category combinations
|
111
111
|
- Dark mode theme with comfortable dark backgrounds and light text
|
@@ -116,7 +116,7 @@ The generated HTML file will be saved in `/tmp/` with a timestamp and automatica
|
|
116
116
|
- Large fonts (18px base size) for excellent readability
|
117
117
|
- Simplified file display (filename only, not full paths)
|
118
118
|
- Optimized column widths with expanded text area for log messages
|
119
|
-
- Date, file, and function names in monospace font
|
119
|
+
- Date, file, line, and function names in monospace font
|
120
120
|
- Color-coded tags for easy categorization
|
121
121
|
|
122
122
|
## Interactive Features
|
data/lib/logviewer/version.rb
CHANGED
data/lib/logviewer.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'json'
|
1
|
+
require 'json'
|
2
2
|
require 'optparse'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'time'
|
@@ -102,6 +102,7 @@ module LogViewer
|
|
102
102
|
tag: tag_string,
|
103
103
|
text: log_entry['message'] || '',
|
104
104
|
file: log_entry['file'] || '',
|
105
|
+
line: log_entry['line'],
|
105
106
|
method: log_entry['function'] || ''
|
106
107
|
}
|
107
108
|
end
|
@@ -168,7 +169,7 @@ module LogViewer
|
|
168
169
|
color: #e0e0e0;
|
169
170
|
}
|
170
171
|
.container {
|
171
|
-
max-width:
|
172
|
+
max-width: 2000px;
|
172
173
|
margin: 0 auto;
|
173
174
|
background: #2d2d2d;
|
174
175
|
border-radius: 8px;
|
@@ -258,6 +259,12 @@ module LogViewer
|
|
258
259
|
word-wrap: break-word;
|
259
260
|
overflow-wrap: break-word;
|
260
261
|
}
|
262
|
+
.line {
|
263
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
264
|
+
font-size: 16px;
|
265
|
+
color: #999;
|
266
|
+
text-align: right;
|
267
|
+
}
|
261
268
|
|
262
269
|
.empty {
|
263
270
|
color: #777;
|
@@ -308,6 +315,7 @@ module LogViewer
|
|
308
315
|
<th style="width: 80px;">Level</th>
|
309
316
|
<th style="width: 120px;">Tag</th>
|
310
317
|
<th style="width: 180px;">File</th>
|
318
|
+
<th style="width: 60px;">Line</th>
|
311
319
|
<th style="width: 300px;">Function</th>
|
312
320
|
<th style="width: auto;">Text</th>
|
313
321
|
</tr>
|
@@ -323,6 +331,7 @@ module LogViewer
|
|
323
331
|
text_content = log[:text].empty? ? '<span class="empty">-</span>' : log[:text]
|
324
332
|
filename = extract_filename(log[:file])
|
325
333
|
file_content = filename.empty? ? '<span class="empty">-</span>' : filename
|
334
|
+
line_content = log[:line].nil? ? '<span class="empty">-</span>' : log[:line]
|
326
335
|
method_content = log[:method].empty? ? '<span class="empty">-</span>' : log[:method]
|
327
336
|
|
328
337
|
html += <<~HTML
|
@@ -331,6 +340,7 @@ module LogViewer
|
|
331
340
|
<td class="level" style="#{level_style}">#{log[:level]}</td>
|
332
341
|
<td class="tag">#{tag_content}</td>
|
333
342
|
<td class="file">#{file_content}</td>
|
343
|
+
<td class="line">#{line_content}</td>
|
334
344
|
<td class="method">#{method_content}</td>
|
335
345
|
<td class="text">#{text_content}</td>
|
336
346
|
</tr>
|
@@ -395,12 +405,17 @@ module LogViewer
|
|
395
405
|
// Update the header count
|
396
406
|
const header = document.querySelector('.header p');
|
397
407
|
const originalText = header.textContent.split(' • ');
|
398
|
-
|
399
|
-
|
408
|
+
const headerParts = [
|
409
|
+
originalText[0], // filename
|
410
|
+
visibleCount + ' entries',
|
411
|
+
'Level: ' + selectedLevel.toUpperCase() + '+'
|
412
|
+
];
|
413
|
+
|
400
414
|
if (selectedTags.length > 0 && selectedTags.length < tagFilter.options.length) {
|
401
|
-
|
415
|
+
headerParts.push('Tags: ' + selectedTags.length + ' selected');
|
402
416
|
}
|
403
|
-
|
417
|
+
|
418
|
+
header.textContent = headerParts.join(' • ');
|
404
419
|
}
|
405
420
|
|
406
421
|
selectAllTagsBtn.addEventListener('click', function() {
|