Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.91k stars 437 forks source link

Script host compilation errors should include function name #1302

Open lindydonna opened 7 years ago

lindydonna commented 7 years ago

Customers using the Functions CLI see errors that just refer to run.csx, without telling them which function they apply to: https://github.com/Azure/azure-functions-cli/issues/44

The script host is just outputing these errors to the console, so it needs to provide a way for the CLI to customize the output.

fabiocav commented 7 years ago

This would be a pretty simple enhancement. Any thoughts on what the output should look like? Both, for the portal and CLI?

rndthoughts commented 7 years ago

At the moment when running the cli we get for each row (for example):

run.csx(11,14): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

Could you either prefix "run.csx" with the function name or path or put a the function name before the errors listed for that function are displayed (preferably in a different colour to red)?

MyAzureFunction

run.csx(11,14): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

run.csx(11,16): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

OR

MyAzureFunction\run.csx(11,14): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

MyAzureFunction\run.csx(11,16): error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)

lindydonna commented 7 years ago

@rndthoughts Thanks for the feedback. I like the second option: MyAzureFunction\run.csx(11,16): error CS0234 ...

fabiocav commented 7 years ago

I like the second option as well.

This will be the same output we'll see in the portal, which may feel a bit odd since the logs are already function scoped, but all this information will (hopefully) eventually come from the structured log stream and the portal could easily format how it wants to display things.