Sha256: c84207f1e6fb7258d7eb86bb144fd365c58c1d8765638dbc71187af375189a42
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
Contents
module RTALogger class LogFilterBase def initialize @title = self.class.to_s.split('::').last.underscore @enable = true end attr_accessor :title attr_accessor :enable attr_accessor :default_regex def match_conditions(log_record) return true if !@enable return log_record.present? end def load_config(config_json) @title = config_json['title'] if config_json['title'].present? @enable = config_json['enable'].nil? ? true : config_json['enable'].present? @default_regex = config_json['default_regex'] if config_json['default_regex'].present? end def apply_run_time_config(config_json) @enable = config_json['enable'].nil? ? true : config_json['enable'].present? @default_regex = config_json['default_regex'] if config_json['default_regex'].present? end def to_builder jb = Jbuilder.new do |json| json.type self.class.to_s.split('::').last.underscore.sub('log_filter_', '') json.title @title json.enable @enable json.default_regex @default_regex end jb end end end
Version data entries
5 entries across 5 versions & 1 rubygems