summaryrefslogtreecommitdiff
path: root/lib/chef/event_dispatch/dispatcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/event_dispatch/dispatcher.rb')
-rw-r--r--lib/chef/event_dispatch/dispatcher.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/chef/event_dispatch/dispatcher.rb b/lib/chef/event_dispatch/dispatcher.rb
index f3e55539a9..affac8fb9d 100644
--- a/lib/chef/event_dispatch/dispatcher.rb
+++ b/lib/chef/event_dispatch/dispatcher.rb
@@ -20,6 +20,16 @@ class Chef
@subscribers << subscriber
end
+ # Check to see if we are dispatching to a formatter
+ def formatter?
+ @subscribers.each do |s|
+ if s.class <= Chef::Formatters::Base && s.class != Chef::Formatters::NullFormatter
+ return true
+ end
+ end
+ false
+ end
+
####
# All messages are unconditionally forwarded to all subscribers, so just
# define the forwarding in one go: