Skip to content

Commit 4f99d7d

Browse files
committed
Updating/simplifying sample script logging
1 parent fc8aa0d commit 4f99d7d

File tree

18 files changed

+27
-24
lines changed

18 files changed

+27
-24
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, input) {
2-
context.log("Node.js script processed queue message '" + input.prop1 + "'");
2+
context.log('Node.js script processed queue message', input.prop1);
33

44
input.val1++;
55
input.prop1 = "third";

sample/BlobTrigger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, blob) {
2-
context.log('Node.js blob trigger function processed blob %s' , blob);
2+
context.log('Node.js blob trigger function processed blob', blob);
33
context.done(null, {
44
output: blob
55
});

sample/DocumentDB-Node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, input) {
2-
context.log('Node.js queue-triggered DocumentDB function called with input ' + input);
2+
context.log('Node.js queue-triggered DocumentDB function called with input', input);
33

44
context.bindings.item = {
55
text: "Hello from Node! " + input

sample/EasyTables-Node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, input) {
2-
context.log('Node.js queue-triggered EasyTable function called with input ' + input);
2+
context.log('Node.js queue-triggered EasyTable function called with input', input);
33

44
context.bindings.item = {
55
Text: "Hello from Node! " + input

sample/ManualTrigger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = function (context, input) {
2-
context.log('Node.js manually triggered function called with input %s', input);
2+
context.log('Node.js manually triggered function called with input', input);
33
context.done();
44
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
module.exports = function (context, input) {
2-
context.log('Queue triggerd Node.js function input: ' + input);
2+
context.log('Queue triggerd Node.js function input:', input);
33
context.log('Sending Template Notification...');
4+
45
context.bindings.notification = {
56
message: "Hello from Node! ",
67
location:"Redmond"
78
};
9+
810
context.done();
911
}

sample/QueueTrigger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, workItem) {
2-
context.log('Node.js queue trigger function processed work item %s', workItem.id);
2+
context.log('Node.js queue trigger function processed work item', workItem.id);
33

44
context.log('DequeueCount=%s', context.bindingData.DequeueCount);
55
context.log('InsertionTime=%s', context.bindingData.InsertionTime);

sample/ServiceBusQueueTrigger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, message) {
2-
context.log("Node.js ServiceBus queue trigger function processed message '" + JSON.stringify(message) + "'");
2+
context.log('Node.js ServiceBus queue trigger function processed message', message);
33

44
var result = null;
55
if (message.count < 1)

sample/TimerTrigger/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = function (context, timerInfo) {
22
var timeStamp = new Date().toISOString();
3-
context.log('Node.js timer trigger function ran! %s', timeStamp);
3+
context.log('Node.js timer trigger function ran!', timeStamp);
44

5-
context.log('PastDue: %s', timerInfo.isPastDue);
6-
context.log('Last: %s', timerInfo.last);
7-
context.log('Next: %s', timerInfo.next);
5+
context.log('PastDue:', timerInfo.isPastDue);
6+
context.log('Last:', timerInfo.last);
7+
context.log('Next:', timerInfo.next);
88

99
context.bindings.message = {
1010
id: Math.floor(Math.random() * 10000) + 1,

sample/WebHook-GitHub/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (context, data) {
2-
context.log('GitHub WebHook triggered! %s', data.comment.body);
2+
context.log('GitHub WebHook triggered!', data.comment.body);
33
context.res = {
44
body: 'New GitHub comment: ' + data.comment.body
55
};

0 commit comments

Comments
 (0)