Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add support for function logs streaming to sandbox #1492
base: main
Are you sure you want to change the base?
feat: add support for function logs streaming to sandbox #1492
Changes from 6 commits
74ccb5f
4d30c77
9141649
11bc7b6
3dacebd
841a4c3
376de18
6fd0a63
e8bbf91
e15bcbf
8fbeb3b
b589fdb
c4d423e
79223a6
ffb9791
b5bcb12
717698d
6187471
18fc156
775b543
a6499ae
4b4b6ec
d141d30
1639594
b4b1506
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
why is this class manipulating colors?
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.
Since this is a central place for performing logging, it's better to turn off/on colors here rather than at the consumers place. Especially since this
$
is a global variable, the colors will only change when one consumer changes it making the colors inconsistent.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.
Aren't the methods in
format
already a noop if colors are not enabled? Why do we need additional logic for it here?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.
format
usessupportColors
which only looks at the environment/terminal you are running in and decides whether to enable or disable colors. E.g. in CI/CD the colors might be disabled. See https://github.com/isaacs/color-supportIn the printer, we might be piping the data in some other place as well (e.g. writing to a file)
supportColors
doesn't know that and will keep the colors enabled.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'm not sure this is right.
If
$.enabled
is global setting but there could be twoPrinter
instances - one writing to console and the other to file - then how do we decide if colors should be enabled or not.So either color control should not be in this class
OR color control should be implemented differently - for example given that node is single threaded try-finally blocks at each printX call could be used.
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 removed it from printer such that printer will print whatever is given to it. Instead of fiddling with kleur's
$
the caller can then choose to not useformat
or colors.