lib/console/capture.rb in console-1.24.0 vs lib/console/capture.rb in console-1.25.0
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2019-2023, by Samuel Williams.
+# Copyright, 2019-2024, by Samuel Williams.
require_relative 'filter'
module Console
# A general sink which captures all events into a buffer.
@@ -38,18 +38,22 @@
def verbose?
@verbose
end
- def call(subject = nil, *arguments, severity: UNKNOWN, **options, &block)
+ def call(subject = nil, *arguments, severity: UNKNOWN, event: nil, **options, &block)
message = {
time: ::Time.now.iso8601,
severity: severity,
**options,
}
if subject
message[:subject] = subject
+ end
+
+ if event
+ message[:event] = event.to_hash
end
if arguments.any?
message[:arguments] = arguments
end