runner.server icon indicating copy to clipboard operation
runner.server copied to clipboard

azexpand command should redirect trace messages to separate log

Open bryanbcook opened this issue 2 years ago • 4 comments

Ideally, gharun azexpand should only provide an expanded template or template validation errors as output. Presently, it contains a mix of TraceWriter and final output if the --quiet flag isn't provided. The TraceWriter output contains all info and verbose output.

Perhaps the --log-output-dir and --verbose flags could influence output?

  • --log-output-dir: don't create a log for trace output unless specified. Use this instead of --quiet?
  • --verbose: control the level of logging that appears in the log.

bryanbcook avatar Nov 30 '23 20:11 bryanbcook

Yes this is a valid concern to expect the azexpand command to only print the final template yaml on success, so doing it like the vscode extension prototype expand command.

ChristopherHX avatar Dec 02 '23 15:12 ChristopherHX

I'm happy to take #277 and #276. Probably within the next two weeks.

bryanbcook avatar Dec 02 '23 19:12 bryanbcook

I'm happy to take #277 and #276. Probably within the next two weeks.

Yes please go ahead. I have just updated the vscode extension to highlight errors tasks and debug adapter backend including removing the stacktrace for them.

ChristopherHX avatar Dec 03 '23 18:12 ChristopherHX

Alternatively I thought we can move the trace log from stdout to stderr.

So gharun azexpand > final.yaml would work, while still logging to console.

stderr needs special syntax to get redirected.

I mean tools like nektos/act just do nothing without logging anything if it doesn't find matching input files and you have no idea why.

ChristopherHX avatar Dec 22 '23 15:12 ChristopherHX