1.1.4 • Published 2 months ago

azure-function-log-intercept v1.1.4

Weekly downloads
572
License
MIT
Repository
github
Last release
2 months ago

azure-function-log-intercept

Build Status

console.log doesn't actually log as you would expect in node.js Azure Functions. You are expected to use context.log and context is not a global object, it's a parameter to your Azure Function so you would have to pass this throughout your modules/functions to get logging like you would expect.

This package fixes this with minimal friction, 0 dependencies, and allows you to use console.log (and other console methods) like normal.

More information here: https://github.com/Azure/Azure-Functions/issues/1396

Supports:

  • console.log
  • console.error
  • console.warn
  • console.info

npm install azure-function-log-intercept

const intercept = require('azure-function-log-intercept');
const storage = require('./StorageService.js');

module.exports = async function (context, myQueueItem) {
    intercept(context);// console.log works now!
    
    await storage.storeMessage(myQueueItem);

    console.log('Function Completed');
};
1.1.4

2 months ago

1.1.3

9 months ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago