[Core] Improve compiler logging with callstacks
The compiler's approach to logging things during compilation needs to be improved as follows:
-
All logging statements should include the source file and line number. Some logging statements, such as those generated within the core Blueprint components, might want to include the caller source file and line number, to provide a bit more detail. -
We should use an errors package that includes the callstack when an error is generated, rather than fmt.Errorf. When an error is generated and logged, we should print the full callstack of the error. -
Currently, whenever the wiring spec defines a node, we save the wiring spec origin as a callsite
property. This additional information can be used to enrich our logging, because it can tie back compilation steps to the specific wiring line that defined nodes. -
Similar to above, we could embed more information in the generated code, as comments, to say where this generated code came from.
Edited by Vaastav Anand