awsutils 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66a6d7913ed1430e8139532c271735a02c32cbd3
4
- data.tar.gz: 4294ebe5a44766ff20355d907221481bf2ce90fc
3
+ metadata.gz: 8b349fef53bb0e69ba94c897c44395410dba6710
4
+ data.tar.gz: e1e33dfd6b6c52810309e0b33304268495521ec2
5
5
  SHA512:
6
- metadata.gz: 84f2d41c4aff7229375783dea1de92a5e5712e0c7d86c889dac53cffec8dd7c6ca65f684f7f85c7dfbac23b3b799e2c9093e8d37ce0346474f241c4ecf6eca95
7
- data.tar.gz: d325a17a1dedd75c97aa41be840abaddb78e12991de1043ac79ff59928d1f6f1005e6eb872bd7ee0f1d1f1f213d8813f997bc01f3d2861ab559af4e87417117f
6
+ metadata.gz: ef0b74c2dbbc588ff444ce4f2993cacc71fbb436889bd0f1cc0a82be835e8db2aeba32eac11d5bf6500811cccfc8e1094efc29e1f6e489a325a429725d83282f
7
+ data.tar.gz: ee242a063408d1712c690fa1d8329c55f692789da9d737945213fd891652e35d8f258c5f3710973304d16a6d60c884af65f96eea08c52919ef5bbb6143381b3d
@@ -28,6 +28,10 @@ module AwsUtils
28
28
  'Show the request ID in every log message',
29
29
  short: 'r',
30
30
  default: false
31
+ opt :request_id,
32
+ 'Print only messages with a specific request ID',
33
+ short: 'R',
34
+ type: :string
31
35
  opt :log_level,
32
36
  'Lowest log level to show',
33
37
  default: 'INFO',
@@ -61,8 +65,13 @@ module AwsUtils
61
65
  collector.sort_by(&:timestamp)
62
66
  end
63
67
 
68
+ def filtered_log_events
69
+ return log_events unless opts[:request_id]
70
+ log_events.select { |event| event.message =~ /\b#{opts[:request_id]}\b/ }
71
+ end
72
+
64
73
  def print_events
65
- log_events.each do |ev|
74
+ filtered_log_events.each do |ev|
66
75
  if ev.message !~ /^\[(INFO|DEBUG|WARNING|ERROR|NOTICE)\]/ # Check if the message is in the standard format
67
76
  print "#{ev.log_stream_name}: " if opts[:show_stream_name]
68
77
  print Time.at(ev.timestamp / 1e3).iso8601(3) + ' ' if opts[:timestamp]
@@ -1,3 +1,3 @@
1
1
  module AwsUtils
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Herot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-16 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler