Closed reiki4040 closed 11 years ago
Please add test! You can test this patch by check for "$log.warn" is called or not, like below:
class DummyLoggerWarnedException < StandardError; end
class DummyLogger
def warn(...)
raise DummyLoggerWarnedException
end
end
saved_logger = $log
$log = DummyLogger.new
d = create_driver # with new option disabled
assert_raise(DummyLoggerWarnedException) {
d.run
...
end
}
d = create_driver # with new option enabled
assert_not_raised {
d.run
...
end
}
$log = saved_logger
And please change option name suppress_parse_error_log
.
(ok, this name is long, but this configuration is abnormal setting.)
I changed name to 'suppress_parse_error_log' and added the test. thank you for example test code.
'rake test' is OK.
ok, this name is long, but this configuration is abnormal setting.
I think so too. it is appropriate name and reason.
Good code! I'll check at my pc, and then merge (and release) later.
Merged and released v0.2.2. Thanks!
Thank you!!
Hi, I add new optional configuration 'unmatch silent' to fluent-plugin-parser.
'unmatch_silent' is optional configuration that suppress 'pattern not match' log. default value is 'false' (it means show 'pattern not match' log)
user can choose output 'pattern not match' to log or not. for example, if it is known that the message does not match the pattern.
if this update is OK, please merge.
I wrote description to blog in japanese. http://d.hatena.ne.jp/reiki4040/20130220/1361372494