Skip to content

Commit b7ecdd1

Browse files
author
Bilal Al
committed
update debug logging in semver matchers
1 parent 418e5d7 commit b7ecdd1

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/splitclient-rb/engine/matchers/between_semver_matcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(attribute, start_value, end_value, logger, validator)
1616
end
1717

1818
def match?(args)
19-
@logger.log_if_debug('[BetweenSemverMatcher] evaluating value and attributes.')
19+
@logger.debug('[BetweenSemverMatcher] evaluating value and attributes.')
2020
return false unless @validator.valid_matcher_arguments(args)
2121

2222
value_to_match = SplitIoClient::Semver.build(args[:attributes][@attribute.to_sym], @logger)
@@ -26,7 +26,7 @@ def match?(args)
2626
end
2727
matches = ([0, -1].include?(@semver_start.compare(value_to_match)) &&
2828
[0, 1].include?(@semver_end.compare(value_to_match)))
29-
@logger.log_if_debug("[BetweenMatcher] #{value_to_match} matches -> #{matches}")
29+
@logger.debug("[BetweenMatcher] #{value_to_match} matches -> #{matches}")
3030
matches
3131
end
3232
end

lib/splitclient-rb/engine/matchers/equal_to_semver_matcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(attribute, string_value, logger, validator)
1515
end
1616

1717
def match?(args)
18-
@logger.log_if_debug('[EqualsToSemverMatcher] evaluating value and attributes.')
18+
@logger.debug('[EqualsToSemverMatcher] evaluating value and attributes.')
1919
return false unless @validator.valid_matcher_arguments(args)
2020

2121
value_to_match = SplitIoClient::Semver.build(args[:attributes][@attribute.to_sym], @logger)
@@ -24,7 +24,7 @@ def match?(args)
2424
return false
2525
end
2626
matches = (@semver.version == value_to_match.version)
27-
@logger.log_if_debug("[EqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
27+
@logger.debug("[EqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
2828
matches
2929
end
3030
end

lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_semver_matcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(attribute, string_value, logger, validator)
1515
end
1616

1717
def match?(args)
18-
@logger.log_if_debug('[GreaterThanOrEqualsToSemverMatcher] evaluating value and attributes.')
18+
@logger.debug('[GreaterThanOrEqualsToSemverMatcher] evaluating value and attributes.')
1919
return false unless @validator.valid_matcher_arguments(args)
2020

2121
value_to_match = SplitIoClient::Semver.build(args[:attributes][@attribute.to_sym], @logger)
@@ -24,7 +24,7 @@ def match?(args)
2424
return false
2525
end
2626
matches = [0, 1].include?(value_to_match.compare(@semver))
27-
@logger.log_if_debug("[GreaterThanOrEqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
27+
@logger.debug("[GreaterThanOrEqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
2828
matches
2929
end
3030
end

lib/splitclient-rb/engine/matchers/in_list_semver_matcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(attribute, list_value, logger, validator)
1515
end
1616

1717
def match?(args)
18-
@logger.log_if_debug('[InListSemverMatcher] evaluating value and attributes.')
18+
@logger.debug('[InListSemverMatcher] evaluating value and attributes.')
1919
return false unless @validator.valid_matcher_arguments(args) && args[:attributes][@attribute.to_sym].is_a?(String)
2020

2121
value_to_match = SplitIoClient::Semver.build(args[:attributes][@attribute.to_sym], @logger)
@@ -24,7 +24,7 @@ def match?(args)
2424
return false
2525
end
2626
matches = (@semver_list.map { |item| item.version == value_to_match.version }).any? { |item| item == true }
27-
@logger.log_if_debug("[InListSemverMatcher] #{value_to_match} matches -> #{matches}")
27+
@logger.debug("[InListSemverMatcher] #{value_to_match} matches -> #{matches}")
2828
matches
2929
end
3030
end

lib/splitclient-rb/engine/matchers/less_than_or_equal_to_semver_matcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(attribute, string_value, logger, validator)
1515
end
1616

1717
def match?(args)
18-
@logger.log_if_debug('[LessThanOrEqualsToSemverMatcher] evaluating value and attributes.')
18+
@logger.debug('[LessThanOrEqualsToSemverMatcher] evaluating value and attributes.')
1919
return false unless @validator.valid_matcher_arguments(args)
2020

2121
value_to_match = SplitIoClient::Semver.build(args[:attributes][@attribute.to_sym], @logger)
@@ -24,7 +24,7 @@ def match?(args)
2424
return false
2525
end
2626
matches = [0, -1].include?(value_to_match.compare(@semver))
27-
@logger.log_if_debug("[LessThanOrEqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
27+
@logger.debug("[LessThanOrEqualsToSemverMatcher] #{value_to_match} matches -> #{matches}")
2828
matches
2929
end
3030
end

0 commit comments

Comments
 (0)