Conversation
|
Closes #41 |
|
Can you elaborate just a bit on your choice of vocabulary used in the api (such as |
|
The vocabulary comes from https://github.com/nomiddlename/log4js-node. An |
scottcorgan
left a comment
There was a problem hiding this comment.
Just a few comments on the code.
Also, I like to take the safe approach and be explicit about default and custom configurations (from my Elm experience).
What do you think about the following APIs?
// Deafults to 'ALL' and 'console'
server.start({
logger: true
});
// Allows you to configure to how you'd like?
server.start({
customLogger: {
level: 'All',
appenders: [
{ type: 'console' }
]
}
});| app.use(compression()) | ||
|
|
||
| // First, check the file system | ||
| // configure logger |
There was a problem hiding this comment.
Should probably only use the logger if they provide a config for it (not default to all the time)
package.json
Outdated
| "compression": "^1.1.0", | ||
| "connect": "^3.2.0", | ||
| "connect-static-file": "^1.1.2", | ||
| "log4js": "^1.1.0", |
There was a problem hiding this comment.
Go ahead and lock the dependency here to the latest current version. (I locked the dependencies recently to avoid any unknown breaking changes)
|
I tend to prefer that logging is enabled by default... but OK! |
scottcorgan
left a comment
There was a problem hiding this comment.
Just a couple more changes. I have to be picky with this because it's used by some big projects and I don't want to break those projects.
Thanks!
| { type: 'console' } | ||
| ] | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Sorry, just a couple more changes, then it's ready to merge! 🎉 . Should probably add an example here of using a logger default values.
| const DIRECTORY = 'public' | ||
| const FILE = 'index.html' | ||
| const HOST = '0.0.0.0' | ||
| const LOGGEROPTIONS = {} |
There was a problem hiding this comment.
I think the default value for this should be false. Then we could check if it's true or an object, then attach the logger.
|
Any updates on this feature? |
It's generally useful for your web servers to have logs!