Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mitchdraft
Copy link
Contributor

@mitchdraft mitchdraft commented Apr 21, 2019

BOT NOTES:
resolves #135
resolves #124
resolves #131

@soloio-bot
Copy link

Issues linked to changelog:
#135

@mitchdraft
Copy link
Contributor Author

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)
Copy link
Member

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)

Copy link
Contributor Author

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.

return []zapcore.Core{consoleStdoutCore, consoleErrCore}
}

func soloPreferredEncoderConfig() zapcore.EncoderConfig {
Copy link
Member

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

Copy link
Contributor Author

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


type CommandConfig struct {
Args string
Command func(context.Context, string) *cobra.Command
Copy link
Member

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

Copy link
Contributor Author

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

@soloio-bot
Copy link

Issues linked to changelog:
#135
#124
#131

Copy link
Member

@EItanya EItanya left a 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
Copy link
Member

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

Copy link
Contributor Author

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

@soloio-bulldozer soloio-bulldozer bot merged commit cb190a8 into master Apr 22, 2019
@soloio-bulldozer soloio-bulldozer bot deleted the clicore branch April 22, 2019 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement an adapter to link zap logs to the console for cli tools add stack trace parser test util port cobra cli utils from gloo

3 participants