-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Listener stdout logging #2291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listener stdout logging #2291
Conversation
011bc87 to
e02f9ab
Compare
src/Runner.Common/Terminal.cs
Outdated
| Console.WriteLine($"# {message}"); | ||
| Console.WriteLine(); | ||
| } | ||
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to update all the Write*() functions in the file to have the else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be weird to change those errors get printed to STDOUT instead STDERR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was more focused on the WriteError() parts. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Solves the Listener part needed for https://github.com/github/c2c-actions-runtime/issues/2065
Worker part to follow