Listener stdout logging#2291
Conversation
011bc87 to
e02f9ab
Compare
| Console.WriteLine($"# {message}"); | ||
| Console.WriteLine(); | ||
| } | ||
| else |
There was a problem hiding this comment.
do we need to update all the Write*() functions in the file to have the else?
There was a problem hiding this comment.
might be weird to change those errors get printed to STDOUT instead STDERR.
There was a problem hiding this comment.
do we need to update all the Write*() functions in the file to have the else?
only the Write*() that don't have a Trace.* Instead of an else, should we actually Trace these always?
We could also do Trace.Info($"WRITE SECTION # {message}"); and Trace.Info($"WRITE SUCCESS √ {message}"); to keep it consistent with other traces in the other Write*() functions?
There was a problem hiding this comment.
I was more focused on the WriteError() parts. 😄
There was a problem hiding this comment.
might be weird to change those errors get printed to STDOUT instead STDERR.
Good point 🤔
In StdoutTraceListener, we could use Console.Error.WriteLine(message); if TraceEventType is ERROR (or CRITICAL)
I think kubectl logs [pod] gives a combined stdout/stderr stream, so it should work for us
8e09417 to
3e14982
Compare
* Added env variable to control wether the terminal is silent * Log to stdout if PrintLogToStdout is enabled * Extracted console logging to stdouttracelistener * Remove useless usings * Rewrite TraceListener as superclass * Only print to stdout if env is set * Add comment for Console.Out * Format Listener * Revert var name in terminal * Check env in hostcontext instead of Tracing constructor * Remove superclass & dupe logging code * Log hostType * Readonly '_' prefix 'hostType' * Fix test * Revert Terminal change Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
Solves the Listener part needed for https://github.com/github/c2c-actions-runtime/issues/2065
Worker part to follow