opscode/opscoderl_wm — pull request #10 by seth (2013-12-15 00:55:50+00:00)
Title: Fix error logging

Fix handling of {log_error, Code, Req, Reason} events

Although the log_error/3 event in webmachine_log has a spec that
indicates that Req is a `#wm_reqdata{}` record, the webmachine code
actually sends `{webmachine_request, #wm_reqstate{}}`.

This patch adds helper functions wm_method, wm_path, and wm_notes to
deal with the expected form. These helpers return undefined if
unexpected data is received to avoid crashing the logger and also
handle receiving a #wm_reqdata{} record.

Also adjusted is the handling of log messages and Reason to take
advantage of the pre-existing handling of notes and msg
annotation. These messages are now merged into the msg annotation
field of notes and emitted as raw.

Tests adjusted for what we see from wm and an additional "bogus" test
added to verify non-crash behavior.

ping @marcparadise @manderson26 @oferrigni @hosh @sdelano @kevsmith