logviewer 2.3.2 → 2.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf4cbd59538ebd5cea3996ab440834261bbf8476e4445b9a99899b71bb44352d
4
- data.tar.gz: 89ed86e379919ee274bf0cd03628e02a29a8fa57f407af3a64da6b0f04b8db1f
3
+ metadata.gz: db20f0ad40b118ced0a130ca5e0b666906a4c20e6faaa175464c6df82239b3fa
4
+ data.tar.gz: 76746d8d2099a5da7a7039f7e57726789d42668e6086246cf7385b43df738191
5
5
  SHA512:
6
- metadata.gz: fc216b0e8fe6c848e6b91c408c32a631770b524cd8f8f0791c8a55da7f4a504106d36170b85f25f392845230f33d040807410db8e34bc5615043b615135e61d5
7
- data.tar.gz: 1b23a018f31fcbc40a00c940e6c86a5b4a1233dde1de7c66f76f05107ad0bfdbcd13b8f7983d5cae5bdff7cbb857e8b341039c52b8a44217d7a0cc482102ecd5
6
+ metadata.gz: 527362782f4b033f386352c35c45306e3bce12582a4c715ee7b1d02284e52c4b2127936575d5166f9c92615143c91d2fba173f1d38def67fd90e87f17b5315d0
7
+ data.tar.gz: 9c94b35d24675ab718b2333d76b362ea6b6cb1c92035974a5b742450538ecad843dff8008a29133047673c0f1015398d37e982164fa472886a897ffbd8a77af7
@@ -1,3 +1,3 @@
1
1
  module LogViewer
2
- VERSION = "2.3.2"
2
+ VERSION = "2.3.3"
3
3
  end
data/lib/logviewer.rb CHANGED
@@ -21,6 +21,7 @@ module LogViewer
21
21
  @args = args
22
22
  @min_level = 'trace'
23
23
  @input_file = nil
24
+ @tail_count = nil
24
25
  end
25
26
 
26
27
  def parse_options
@@ -38,6 +39,14 @@ module LogViewer
38
39
  end
39
40
  end
40
41
 
42
+ opts.on('-n', '--tail COUNT', Integer, 'Show only the most recent N log entries') do |count|
43
+ if count <= 0
44
+ puts "Error: tail count must be a positive integer"
45
+ exit 1
46
+ end
47
+ @tail_count = count
48
+ end
49
+
41
50
  opts.on('-v', '--version', 'Show version') do
42
51
  puts "logviewer #{LogViewer::VERSION}"
43
52
  exit
@@ -452,7 +461,14 @@ module LogViewer
452
461
  puts "Minimum log level: #{@min_level}"
453
462
 
454
463
  logs = parse_logs
455
- puts "Found #{logs.length} log entries matching criteria"
464
+
465
+ # Apply tail limit if specified
466
+ if @tail_count && logs.length > @tail_count
467
+ logs = logs.last(@tail_count)
468
+ puts "Found #{logs.length} log entries (showing most recent #{@tail_count})"
469
+ else
470
+ puts "Found #{logs.length} log entries matching criteria"
471
+ end
456
472
 
457
473
  if logs.empty?
458
474
  puts "No log entries found matching the specified criteria."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logviewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bishop