test/appender/file_test.rb in semantic_logger-4.2.2 vs test/appender/file_test.rb in semantic_logger-4.3.0
- old
+ new
@@ -62,9 +62,19 @@
exc = StandardError.new('StandardError')
exc.set_backtrace([])
@appender.debug exc
assert_match(/\d+-\d+-\d+ \d+:\d+:\d+.\d+ D \[\d+:#{@thread_name}\] SemanticLogger::Appender::File -- Exception: StandardError: StandardError\n\n/, @io.string)
end
+
+ it 'ignores metric only messages' do
+ @appender.debug metric: 'my/custom/metric'
+ assert_equal '', @io.string
+ end
+
+ it 'ignores metric only messages with payload' do
+ @appender.debug metric: 'my/custom/metric', payload: {hello: :world}
+ assert_equal '', @io.string
+ end
end
describe 'for each log level' do
# Ensure that any log level can be logged
SemanticLogger::LEVELS.each do |level|