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

[v2] New interfaces to configure Puree #22

Merged
merged 12 commits into from
Feb 26, 2015
Merged

[v2] New interfaces to configure Puree #22

merged 12 commits into from
Feb 26, 2015

Conversation

rejasupotaro
Copy link
Contributor

I'd like to change interfaces to configure Puree. Because

  • I don't want to specify TAG when I send log
  • It's not easy to understand where log is sent

Before

Destination definition is far apart from sender.

new PureeConfiguration.Builder(context)
    .registerOutput(new OutDisplay())
    .registerOutput(new OutBufferedLogcat(), addEventTimeFilter, samplingFilter)
    .registerOutput(new OutLogcat(), addEventTimeFilter)
    .build();

I need to know where I should send logs.
In addition, It's not good that I have to specify output plugin by String.

Puree.send(new ClickLog("MainActivity", "BUTTON 1"), OutDisplay.TAG);
Puree.send(new ClickLog("MainActivity", "BUTTON 2"), OutDisplay.TAG);
...

After

It's easy to understand where log is sent at a glance.

new PureeConfiguration.Builder(context)
    .source(ClickLog.class).to(new OutDisplay())
    .source(ClickLog.class).filters(addEventTimeFilter, samplingFilter).to(new OutBufferedLogcat())
    .source(PvLog.class).filter(addEventTimeFilter).to(new OutLogcat())
    .build();
Puree.send(new ClickLog("MainActivity", "BUTTON 1"));
Puree.send(new ClickLog("MainActivity", "BUTTON 2"));
...

It looks simple and intuitive.

screen shot 2015-02-21 at 10 18 41

Todo

  • Change interfaces
  • Add tests
  • Update documents
  • Update v2.0.0

@rejasupotaro rejasupotaro changed the title [WIP] Propose v2.0.0 [WIP] Propose new interfaces to configure Puree Feb 20, 2015
@rejasupotaro rejasupotaro changed the title [WIP] Propose new interfaces to configure Puree [WIP] [Proposal] New interfaces to configure Puree Feb 20, 2015
@rejasupotaro
Copy link
Contributor Author

@sys1yagi @slightair @gfx What do you think?

@sys1yagi
Copy link

LGTM. 👍

@rejasupotaro rejasupotaro changed the title [WIP] [Proposal] New interfaces to configure Puree [Proposal] New interfaces to configure Puree Feb 24, 2015
@rejasupotaro
Copy link
Contributor Author

@sys1yagi @slightair @gfx Finished. We decided to focus on managing logs in this library. I'll upload to jcenter if there is anything.

@slightair
Copy link

LGTM 👍

@gfx
Copy link
Contributor

gfx commented Feb 26, 2015

👀

@rejasupotaro
Copy link
Contributor Author

Thanks guys!

rejasupotaro added a commit that referenced this pull request Feb 26, 2015
[Proposal] New interfaces to configure Puree
@rejasupotaro rejasupotaro merged commit 75eec83 into master Feb 26, 2015
@rejasupotaro rejasupotaro deleted the v2.0.0 branch February 26, 2015 02:45
@gfx gfx changed the title [Proposal] New interfaces to configure Puree [v2] New interfaces to configure Puree Jun 11, 2015
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.

4 participants