-
Notifications
You must be signed in to change notification settings - Fork 596
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
Initial import of logging-bunyan #1977
Conversation
|
||
'use strict'; | ||
|
||
var assert = require('assert'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Hello! There's an unofficial, moderately popular Bunyan transport as well: https://github.com/mlazarov/bunyan-stackdriver If it helps, the key differences I see are:
|
Hello @zbjornson! Thanks for chiming in. We wanted to start officially support a module for working with bunyan (and winston: #1830). It would be great to have your collaboration. This is an initial version of the library here, but I do have some thoughts on the points you highlighted:
We can start addressing these in follow-ons. Again, collaboration would be most welcome! |
Sounds great! I'm a bit short on time for the next few days to actually code, but happy to review and discuss anything. Let me know how I can help. |
6d5ec6f
to
0e63ff0
Compare
@GoogleCloudPlatform/node-team, @stephenplusplus This is ready for review. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to check in the yarn.lock
file?
Yes. No reason not to.
…On Fri, Feb 10, 2017 at 12:50 PM Matthew Loring ***@***.***> wrote:
***@***.**** commented on this pull request.
Do we want to check in the yarn.lock file?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1977 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE0qV1G2agVxUxelhCotlqk9407fQ9vks5rbM2jgaJpZM4L8fEU>
.
|
packages/logging-bunyan/README.md
Outdated
streams: [loggingBunyan.stream('info')] | ||
}); | ||
|
||
logger.error('warp nacelles offline'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,46 @@ | |||
{ | |||
"name": "@google-cloud/logging-bunyan", | |||
"version": "0.0.0", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/logging-bunyan/src/index.js
Outdated
this.log_[level](entry, function() {}); | ||
}; | ||
|
||
module.exports = LoggingBunyan; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
}); | ||
|
||
}); | ||
}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/logging-bunyan/src/index.js
Outdated
'@google-cloud/logging-bunyan only works as a raw bunyan stream type.'); | ||
} | ||
var level = BUNYAN_TO_STACKDRIVER[rec.level]; | ||
var entryMetadata = {resource: this.resource_, timestamp: rec.time}; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
options = options || {}; | ||
|
||
this.logName_ = options.logName || 'bunyan_log'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Once functionality is approved by the reviewers, I'll do some simple linting/style stuff. |
@zbjornson for the issues/feature requests you raised:
|
bueno, thanks! Looks like everything is addressed here or tracked in other issues. |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
@ofrobots I went over it for lint/nit/style changes. The biggest change was probably that I removed tests that were using the Bunyan module inside of the unit test file for |
LGTM. The removed tests are not that significant test of the interop to be really worth keeping. |
packages/logging-bunyan/README.md
Outdated
@@ -35,19 +29,12 @@ logger.info('shields at 99%'); | |||
|
|||
It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. | |||
|
|||
### On Google Cloud Platform | |||
### On Google Compute Engine |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Let us know if there is anything more needed from our side before this can land. Once this lands, we can start work on some follow-on PRs. |
Just waiting on me? |
@google-cloud/[email protected] published. |
This PR adds a new module @google-cloud/logging-bunyan that provides simple, minimal config way of logging to Stackdriver Logging from applications using bunyan.