Skip to content
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

Fix log command error #153

Merged
merged 1 commit into from
Jun 19, 2017
Merged

Conversation

typhoonzero
Copy link
Collaborator

Fix #145

@@ -53,7 +53,8 @@ func (p *LogsCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...interface

respBody, err := utils.GetCall(utils.Config.ActiveConfig.Endpoint+"/api/v1/logs", queryMap)
if err != nil {
fmt.Fprintf(os.Stderr, "call paddle cloud error %v", err)
fmt.Fprintf(os.Stderr, "call paddle cloud error %v, %v", err, respBody)
Copy link
Collaborator

@helinwang helinwang Jun 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's easier for viewing to print string instead of []byte, I could be wrong, because string could contain new line or strange characters which could break the log.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing string or []byte can both use %s. Newline can also contain in a string which will affect the log printing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks! Did not know about %s can be used on []byte.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did. both %v and %s works for []byte

@typhoonzero typhoonzero merged commit 6178f9d into PaddlePaddle:develop Jun 19, 2017
@typhoonzero typhoonzero deleted the fix_log_command branch November 2, 2017 10:05
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.

2 participants