Class: Logster::SuppressionPattern

Inherits:
Pattern
  • Object
show all
Defined in:
lib/logster/suppression_pattern.rb

Constant Summary collapse

CACHE_KEY =
:suppression

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pattern

child_classes, find, find_all, inherited, #initialize, #modify, parse_pattern, #pattern, #to_s, valid?, #valid?

Constructor Details

This class inherits a constructor from Logster::Pattern

Class Method Details

.set_nameObject



6
7
8
# File 'lib/logster/suppression_pattern.rb', line 6

def self.set_name
  "__LOGSTER__suppression_patterns_set".freeze
end

Instance Method Details

#destroy(clear_cache: true) ⇒ Object

arg used in tests



16
17
18
19
20
# File 'lib/logster/suppression_pattern.rb', line 16

def destroy(clear_cache: true) # arg used in tests
  super()
  @store.remove_ignore_count(self.to_s)
  @store.clear_patterns_cache(CACHE_KEY) if clear_cache
end

#save(args = {}) ⇒ Object



10
11
12
13
14
# File 'lib/logster/suppression_pattern.rb', line 10

def save(args = {})
  super
  @store.clear_patterns_cache(CACHE_KEY)
  retro_delete_messages if args[:retroactive]
end