Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Sketch out key-value logging #53

Merged
merged 4 commits into from
Sep 14, 2016
Merged

Sketch out key-value logging #53

merged 4 commits into from
Sep 14, 2016

Conversation

bhs
Copy link
Contributor

@bhs bhs commented Sep 3, 2016

Per opentracing/opentracing.io#96

This is only a sketch... once we decide on a specific API I will adjust tests and so on.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 71.886% when pulling 2e2cb0e on bhs/log_kv into 72945db on master.

@bhs
Copy link
Contributor Author

bhs commented Sep 3, 2016

(I added a simple usage example)

@bcronin please take a look (before I flesh this out)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 71.886% when pulling 3af5d8d on bhs/log_kv into 72945db on master.

* @param {string} eventName - string associated with the log record
* @param {object} [payload] - arbitrary payload object associated with the
* log record.
* DEPRECATED
*/
logEvent(eventName, payload) {
// Debug-only runtime checks on the arguments
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should if DEBUG branch warn about the deprecation? Something like...

 if (process.env.NODE_ENV === 'debug') {
    console.warn('logEvent has been deprecated. Use log() instead.');
     if (arguments.length >= 1 && arguments.length <= 2) {
     ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO no, but it's just MO :)

@bcronin
Copy link
Collaborator

bcronin commented Sep 4, 2016

Makes sense to me 👍

@yurishkuro
Copy link
Member

@bensigelman LGTM, can we merge this?

@bhs
Copy link
Contributor Author

bhs commented Sep 13, 2016

@yurishkuro sure... in general I was waiting on these PRs until the dust had settled in the various languages. I guess that's happened. Merging now...

@bhs
Copy link
Contributor Author

bhs commented Sep 13, 2016

Actually, I want to briefly check to make sure the testing stuff that's recently merged is up-to-date.

@yurishkuro
Copy link
Member

The testing harness is most likely checking the old log(fields) API, which did not accept the timestamp as the second arg.

@bhs
Copy link
Contributor Author

bhs commented Sep 14, 2016

@yurishkuro @bcronin @oibe I added some stuff in commit 5f43e5c

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 84.669% when pulling 956ac06 on bhs/log_kv into 215ca2e on master.

*
* span.log({
* "error.description": error.description(), // numeric value
* }, error.timestampMillis());
Copy link
Member

Choose a reason for hiding this comment

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

Q: what's error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is/was just an imaginary example object... and I'm annoyed that I just merged this since the preceding line has an incorrect "numeric value" comment. I'll fix that in master.

@yurishkuro
Copy link
Member

LGTM

@bhs
Copy link
Contributor Author

bhs commented Sep 14, 2016

Alright, I'm going to merge this. Hopefully not controversial at this point.

@bhs bhs merged commit 6e1c608 into master Sep 14, 2016
@bhs bhs deleted the bhs/log_kv branch September 14, 2016 03:57
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.

None yet

4 participants