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

Update to new interface of Good and es6 #67

Merged
merged 2 commits into from Mar 30, 2016
Merged

Conversation

thebergamo
Copy link
Contributor

Well, this is a refactoring inspired for the issues #63 #64 and #65.

@arb can review?

NOTE: Well, I started this refactoring before the PR #66 are pushed, I have some delay to understand the new interface of Good and deal with Stream was a good xp.

@arb arb self-assigned this Mar 18, 2016
@arb arb added this to the 6.0.0 milestone Mar 18, 2016
@arb arb added the breaking changes Change that can breaking existing code label Mar 18, 2016
@@ -2,5 +2,5 @@ sudo: false
language: node_js

node_js:
- 0.10
- 4
- 4
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to be "4" and "node"


/*eslint-disable */
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to this logic? We need this still somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tags isn't used on all events. Just in events: response (but is in event.logs[i].tags) log and request event.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you look at the old code, I normalized this so that every event did include tags and the first tag was always the eventName.


const Joi = require('joi');

exports.reporter = Joi.object().keys({
Copy link
Contributor

Choose a reason for hiding this comment

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

Using joi here is kind of overkill. Just use the default values logic that was there before.

@thebergamo
Copy link
Contributor Author

@arb can review?

@@ -10,33 +10,23 @@ Lead Maintainer: [Adam Bretz](https://github.com/arb)

`good-console` is a [good](https://github.com/hapijs/good) reporter implementation to write [hapi](http://hapijs.com/) server events to the console.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this to read something about a transform stream into formatted strings.

@thebergamo
Copy link
Contributor Author

any other tips?

if (typeof event.responsePayload === 'object' && event.responsePayload) {
responsePayload = 'response payload: ' + SafeStringify(event.responsePayload);
config = config || {};
this.settings = Hoek.applyToDefaults(internals.defaults, config);
Copy link
Contributor

Choose a reason for hiding this comment

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

this._settings since we want to keep people out.

@thebergamo
Copy link
Contributor Author

I update de README.md with the tags information on the example of outputs.

@thebergamo
Copy link
Contributor Author

@arb some news?

@arb
Copy link
Contributor

arb commented Mar 22, 2016

@thebergamo I haven't forgotten; I will get to it when I can.

@thebergamo
Copy link
Contributor Author

ok, sorry for my impatience :(

@arb arb merged commit a89a608 into hapijs:master Mar 30, 2016
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants