diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-07-28 15:17:03 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-10-22 13:03:15 -0700 |
commit | 37cccee7628cab1f512ee9c77d700d6bcdce9d75 (patch) | |
tree | b0acfa3ff26498823f606ee820fff55f31795b3d /lib | |
parent | f83e13f6aae353533cfff74a0adc71a5f91673a6 (diff) | |
download | chef-37cccee7628cab1f512ee9c77d700d6bcdce9d75.tar.gz |
Spacing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/logging/windows_eventlog.rb | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/lib/chef/logging/windows_eventlog.rb b/lib/chef/logging/windows_eventlog.rb index 8f657449a2..8609d95846 100644 --- a/lib/chef/logging/windows_eventlog.rb +++ b/lib/chef/logging/windows_eventlog.rb @@ -3,69 +3,69 @@ require 'win32/eventlog' include Win32 class Chef - module Logging - class WindowsEventLogger < Logging::EventLogger - # These must match those that are defined in the manifest file - RUN_START_EVENT_ID = 10000 - RUN_STARTED_EVENT_ID = 10001 - RUN_COMPLETED_EVENT_ID = 10002 - RUN_FAILED_EVENT_ID = 10003 + module Logging + class WindowsEventLogger < Logging::EventLogger + # These must match those that are defined in the manifest file + RUN_START_EVENT_ID = 10000 + RUN_STARTED_EVENT_ID = 10001 + RUN_COMPLETED_EVENT_ID = 10002 + RUN_FAILED_EVENT_ID = 10003 - EVENT_CATEGORY_ID = 11000 - LOG_CATEGORY_ID = 11001 + EVENT_CATEGORY_ID = 11000 + LOG_CATEGORY_ID = 11001 - # Since we must install the event logger, this is not really configurable - SOURCE = 'RubyMsg' + # Since we must install the event logger, this is not really configurable + SOURCE = 'RubyMsg' - def initialize - @eventlog = EventLog::open('EventWriter') - end + def initialize + @eventlog = EventLog::open('EventWriter') + end - def run_start(version) - @eventlog.report_event( - :event_type => EventLog::INFO_TYPE, - :source => SOURCE, - :event_id => RUN_START_EVENT_ID, - :data => [version] - ) - end + def run_start(version) + @eventlog.report_event( + :event_type => EventLog::INFO_TYPE, + :source => SOURCE, + :event_id => RUN_START_EVENT_ID, + :data => [version] + ) + end - def run_started(run_status) - @run_status = run_status - @eventlog.report_event( - :event_type => EventLog::INFO_TYPE, - :source => SOURCE, - :event_id => RUN_STARTED_EVENT_ID, - :data => [run_status.run_id] - ) - end + def run_started(run_status) + @run_status = run_status + @eventlog.report_event( + :event_type => EventLog::INFO_TYPE, + :source => SOURCE, + :event_id => RUN_STARTED_EVENT_ID, + :data => [run_status.run_id] + ) + end - def run_completed(node) - @eventlog.report_event( - :event_type => EventLog::INFO_TYPE, - :source => SOURCE, - :event_id => RUN_COMPLETED_EVENT_ID, - :data => [@run_status.run_id, @run_status.elapsed_time.to_s] - ) - end + def run_completed(node) + @eventlog.report_event( + :event_type => EventLog::INFO_TYPE, + :source => SOURCE, + :event_id => RUN_COMPLETED_EVENT_ID, + :data => [@run_status.run_id, @run_status.elapsed_time.to_s] + ) + end - #Failed chef-client run %1 in %2 seconds. - #Exception type: %3 - #Exception message: %4 - #Exception backtrace: %5 - def run_failed(e) - @eventlog.report_event( - :event_type => EventLog::ERROR_TYPE, - :source => SOURCE, - :event_id => RUN_FAILED_EVENT_ID, - :data => [@run_status.run_id, - @run_status.elapsed_time.to_s, - e.class.name, - e.message, - e.backtrace.join("\n")] - ) - end + #Failed chef-client run %1 in %2 seconds. + #Exception type: %3 + #Exception message: %4 + #Exception backtrace: %5 + def run_failed(e) + @eventlog.report_event( + :event_type => EventLog::ERROR_TYPE, + :source => SOURCE, + :event_id => RUN_FAILED_EVENT_ID, + :data => [@run_status.run_id, + @run_status.elapsed_time.to_s, + e.class.name, + e.message, + e.backtrace.join("\n")] + ) + end - end end + end end |