-
Couldn't load subscription status.
- Fork 22
extract clilog from gs #134
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
Conversation
|
Issues linked to changelog: |
|
This will be updated with feedback from originating pr |
| //file, err := os.OpenFile(path, os.O_WRONLY|os.O_APPEND, os.ModeAppend) | ||
|
|
||
| // for now, let's just create/overwrite the file each time | ||
| file, err := os.Create(path) |
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.
fwiw this line will open a file in append mode if it exists, or create it if if doesn't
file, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
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.
Interesting, I wonder if O_APPEND is a superset of O_CREATE because the line I referenced worked too. Either way, I think for now we don't want to risk growing massive log files so storing only the output from the last command seems right to me.
clicore/logger.go
Outdated
| return []zapcore.Core{consoleStdoutCore, consoleErrCore} | ||
| } | ||
|
|
||
| func soloPreferredEncoderConfig() zapcore.EncoderConfig { |
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.
nit: defaultEncoderConfig()
Current one seems overly verbose
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.
updated in solo-io/glooshot#22
clicore/runner.go
Outdated
|
|
||
| type CommandConfig struct { | ||
| Args string | ||
| Command func(context.Context, string) *cobra.Command |
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.
nit: define a type for this function
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.
good idea, added solo-io/glooshot#22
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.
lgtm
| @@ -0,0 +1,5 @@ | |||
| package constants | |||
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 wondering why this is in an entirely different package. I get that it is a constant but it's completely tied to the clicore main package and if I were a user of this package I would definitely look there first
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.
@EItanya there was an import cycle between clicore and contextutils
BOT NOTES:
resolves #135
resolves #124
resolves #131