diff --git a/src/subroutines/matchSubroutine.js b/src/subroutines/matchSubroutine.js index 96ad87b..031747f 100644 --- a/src/subroutines/matchSubroutine.js +++ b/src/subroutines/matchSubroutine.js @@ -10,6 +10,11 @@ import { import { InvalidValueSentinel } from '../sentinels'; +import Logger from '../Logger'; + +const log = Logger.child({ + namespace: 'subroutine:match' +}); const matchSubroutine = (subject: string, [userRule, sprintfFormat]: $ReadOnlyArray) => { const rule: RegExp = parseRegex(userRule); @@ -21,6 +26,10 @@ const matchSubroutine = (subject: string, [userRule, sprintfFormat]: $ReadOnlyAr const matches = subject.match(rule); if (!matches) { + log.debug({ + input: subject + }, 'input'); + return new InvalidValueSentinel('Input does not match "' + rule.toString() + '" regular expression.'); }