-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support skipping logger creation if it is provided #6
base: main
Are you sure you want to change the base?
Conversation
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.
Seems like a fair enough feature.
The docs could use some updating though to reflect this.
e.g. https://github.com/godaddy/slay#app , https://github.com/godaddy/slay#app-startup-in-detail
And perhaps a sample of how to provide your own logger and what that "interface" for a logger should look like (given that some internal components to slay are going to call methods on app.log).
Also perhaps an e2e test showing that a custom logger can work here without crashing, stuff actually gets logged to it, etc.
@@ -6,7 +6,7 @@ const gulp = require('gulp'); | |||
process.env.NODE_ENV = process.env.NODE_ENV || 'development'; | |||
|
|||
require('godaddy-test-tools')(gulp, { | |||
lint: { files: ['*.js', 'lib/**/*.js', 'test/*.js'] }, | |||
lint: { files: ['*.js', 'lib/**/*.js', 'test/**/*.js'] }, |
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.
I'm not super familiar with gulp, but depending on platform and how this gets used you may need to include both test/*.js
and test/**/*.js
.
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.
Reasonable enough indeed, but we should probably put in the effort to discuss the capabilities of such a module an document them in-depth before saying "any object will do for app.log
".
A good way to start that discussion is: what logger are you replacing winston with? We can do a capabilities diff from there as a straw person.
@@ -9,6 +9,11 @@ var debug = require('diagnostics')('slay:preboot:logger'); | |||
* a winston Logger for this app instance. | |||
*/ | |||
module.exports = function (app, options, callback) { | |||
if (app.log) { |
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.
This capability checking is not quite enough as there are a few calls to app.log.info
in the other preboots.
The allows:
winston
logger.winston
transport configuration, when not used.