Class: AwsUtils::AwsLogs

Inherits:
Object
  • Object
show all
Defined in:
lib/awsutils/awslogs.rb

Constant Summary collapse

LOG_LEVELS =
%w[TRACE DEBUG INFO NOTICE WARNING ERROR FATAL].freeze
MAX_EVENTS =
100_000
MAX_STREAMS =
100

Instance Method Summary collapse

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/awsutils/awslogs.rb', line 17

def run
  print_events
rescue TooManyEventsError
  puts "Too many log events to process (MAX: #{MAX_EVENTS}). " \
       'Please try filtering the output with -f'
  exit 3
rescue TooManyStreamsError
  puts "Too many streams to process (MAX: #{MAX_STREAMS}). " \
       'Please try filtering the output with -s'
  exit 3
rescue LogGroupNotFoundError
  puts "No log groups found starting with #{opts[:group]}"
  exit 1
rescue NoStreamsError
  puts 'Streams filter did not return any streams'
  exit 1
rescue MultipleGroupsError => e
  puts e.message
  exit 2
end