Closed Qard closed 5 years ago
Totals | |
---|---|
Change from base Build 356: | 0.0% |
Covered Lines: | 749 |
Relevant Lines: | 827 |
@fieldju Does this look good to you? I'd like to land and release this soon, if I can.
Oh yeah, this look good to me. I've been on vacation sorry.
@watson idea of just falling back to console log and having pino just be a dev dep.
I don't have strong opinions on this one
Alternatively, we could use a null logger by default which implements the logger interface but just drops the messages.
I discussed a bit more with @watson and we're thinking it would be better to move the LoggingReporter
out to a separate module so the log module dependencies can be removed entirely from our install. This would instead leave measured-reporting as mainly just a bundle of abstract classes. This would mean neither bunyan nor pino would be required in this module and would only be required in the module which provides the concrete implementation for the LoggingReporter
class.
If this seems like a reasonable approach to you, let me know what you would want to call the new log reporter module and I can write a PR to split the two.
I think just defaulting to console.log would be good enough.
The main purpose of the logging reporter is to have a reference reporter as well as have something that is handy for local developing / debugging. I think just defaulting to console.log is decent since it doesn't require an external lib and still is functional and can be overridden by supplying your own impl.
Can you update this to use console log and we can merge and deploy it out?
In that case, @watson, what do you think of using https://www.npmjs.com/package/console-log-level rather than pino here?
@Qard Fine with me 👍
I just opened a new PR to use console-log-level instead. #62
Bunyan has an optional dependency on dtrace-provider, which is a native module. With optional dependencies, it's fine for them to fail to install. On Windows, however, the build process uses node-gyp and therefore fails the install with a big scary error.
To avoid the build error, I've switched the logger to pino.
Fixes #60