Skip to content

Commit 8a9366a

Browse files
author
Igor Drobiazko
committed
Minor log cleanup
1 parent d2285a8 commit 8a9366a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/actions/createEvent.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ function processAction(msg, cfg) {
3434

3535
const instance = new ApiClient(cfg);
3636

37-
console.log(cfg);
38-
3937
function createEvent(postRequestBody) {
4038
console.log('Creating Event with properties:');
41-
console.log(postRequestBody);
39+
console.log(JSON.stringify(postRequestBody, null, 2));
4240
return instance.post(apiCall, postRequestBody);
4341
}
4442

4543
function emitData(data) {
46-
console.log('Emitting data ...');
47-
let messageBody = {
48-
id: data.id,
49-
calendarId: cfg.calendarId
50-
};
51-
self.emit('data', messages.newMessageWithBody(messageBody));
44+
const id = data.id;
45+
console.log('Successfully created event with ID=', id);
46+
let messageBody = {
47+
id,
48+
calendarId: cfg.calendarId
49+
};
50+
console.log('Emitting data ...');
51+
self.emit('data', messages.newMessageWithBody(messageBody));
5252
}
5353

5454
function emitError(e) {

0 commit comments

Comments
 (0)