summaryrefslogtreecommitdiff
path: root/lib/chef/log
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-05-12 06:17:36 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-05-12 06:17:36 -0700
commite57f5c1be36f97b7eca886a99d86fd207240bc34 (patch)
tree7e85fe92951c2d902b6054d9209f4b554a005d81 /lib/chef/log
parent6687bae7bede7919dd50c78379425c76fd3fca70 (diff)
downloadchef-e57f5c1be36f97b7eca886a99d86fd207240bc34.tar.gz
Added errorjdm/winevt
Diffstat (limited to 'lib/chef/log')
-rw-r--r--lib/chef/log/winevt.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb
index e355ff8162..c5b7c3485a 100644
--- a/lib/chef/log/winevt.rb
+++ b/lib/chef/log/winevt.rb
@@ -32,7 +32,8 @@ class Chef
INFO_EVENT_ID = 10100
WARN_EVENT_ID = 10101
DEBUG_EVENT_ID = 10102
- FATAL_EVENT_ID = 10103
+ ERROR_EVENT_ID = 10103
+ FATAL_EVENT_ID = 10104
# Since we must install the event logger, this is not really configurable
SOURCE = 'Chef'
@@ -75,6 +76,15 @@ class Chef
)
end
+ def error(msg)
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::ERROR_TYPE,
+ :source => SOURCE,
+ :event_id => ERROR_EVENT_ID,
+ :data => [msg]
+ )
+ end
+
def fatal(msg)
@eventlog.report_event(
:event_type => ::Win32::EventLog::ERROR_TYPE,