From c40e6126d907cd9107fc09f5888793733b00d326 Mon Sep 17 00:00:00 2001 From: Etha-Arrowood Date: Fri, 14 Sep 2018 13:41:23 -0400 Subject: [PATCH] Update readme to better explain auditer --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b051759..e5361b7 100644 --- a/README.md +++ b/README.md @@ -85,20 +85,18 @@ const objs = require('azure-chaos-fn/parsers').resourcesToObjects(req) ### auditer -A documented implementation of the verbose logging format defined in [Auditing](https://github.com/Azure/platform-chaos/wiki/Auditing) +A documented implementation of the verbose logging format defined in [Auditing](https://github.com/Azure/platform-chaos/wiki/Auditing). The auditer is implemented by monkeypatching the `context` instance _log_ and _done_ methods. As a developer there is little extra effort you need to do to start using the auditer. At the beginning of your extension file, initialize the auditer by passing in the eventName and resources. Then use `context.log` as usual. Everything you log will be added to an intern audit list. When you call `context.done` at the end of your extension, the internal audit list is appended to the `context.res.body` under the `__audits` property. Initialize the auditer by using the following method: ```js const index = require('azure-chaos-fn') index.auditer(/* Azure Function context */, { - eventName: /* Chaos event name */, - resource: /* Target resource */ + eventName: /* Chaos event name : string */, + resources: /* Target resources : string */ }) ``` -Once initialized you just need to use `context.log` as normal and anything you log will be added to an audit object that is attached the response body when you run `context.done()`. Access the audits via `res.body.__audits`. - See a fully implemented example in [this]() chaos event. > TODO: Add an example project for 'this'