Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Add parameter for logging JSON traffic to stdout - #125

Merged
wennmo merged 5 commits into
masterfrom
traffic
Feb 11, 2019
Merged

wennmo merged 5 commits into
masterfrom
traffic

Conversation

@wennmo

@wennmo wennmo commented Feb 9, 2019

Copy link
Copy Markdown
Member

This PR adds a parameter --traffic or -t that enables JSON traffic logging to stdout.

Closes #116

Comment thread docs/corectl.md Outdated

```
-h, --help help for corectl
-t, --traffic Log JSON traffic to stdout

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

QIX WS traffic?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In my opinion we shouldn't use QIX, but maybe Log JSON websocket traffic to stdout?

@FredrikFolkesson FredrikFolkesson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Some minor comments

Comment thread main.go Outdated
corectlCommand.PersistentFlags().BoolP("verbose", "v", false, "Logs extra information")
viper.BindPFlag("verbose", corectlCommand.PersistentFlags().Lookup("verbose"))

corectlCommand.PersistentFlags().BoolP("traffic", "t", false, "Log JSON traffic to stdout")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change to "Log JSON websocket traffic to stdout" as above :)

Comment thread internal/log.go Outdated

type TrafficLogger struct{}

func (l *TrafficLogger) Opened() {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the object, and test if it works with a value receiver instead of a pointer

@wennmo
wennmo merged commit 879bef0 into master Feb 11, 2019
@wennmo
wennmo deleted the traffic branch February 11, 2019 11:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ 换网址