-
Notifications
You must be signed in to change notification settings - Fork 2k
Remove unused parameter from function logger.setupFileLogger #1482
Comments
I think it's customary to leave such parameters in, just to make clear to future readers of the code that options can be passed to the function. |
There was some work done with this functionality recently, to clean up the implementation. The support for passing options was left in place, so perhaps this was just missed. We could pass in the options here: Line 44 in c8cbcd3
@lirantal Was it intentional to not pass the options here, or was it just missed? |
Looked at it but I can't remember why I left it there. If it's unused then we can move it out. |
btw shouldn't eslint catch un-used parameters? |
No, because it's disabled. |
I'd say error. Others? |
We should add the options to this call: Line 44 in c8cbcd3
We need to provide the option for our users to pass in their own configuration for Winston to Line 77 in c8cbcd3
Also, why are we bothering to pull in the whole config here? We should just use the section of the config that we're concerned with ( IMO, eslint should throw an error in the case of an unused parameter. |
Good points @mleanos, I'll take a look. |
Setting no-unused-vars will hiccup quite a bit on issues so that's probably not the time to enable it:
|
Ok. Definitely not the time to enable. We'll have to look at these later. Probably after 0.5.0 is released. |
@mleanos I know what you're talking about but to be honest fixing that |
I'll clean that part up but because anyway the log options are taken from the config object it doesn't seem to make sense to pass more options to it. |
@lirantal I was more referring to how the Line 79 in c8cbcd3
This way if any of our users want to override, or add an additional, option to the Winston logger, all they would need to do is pass it in at this line: Line 144 in c8cbcd3
For instance: logger.setupFileLogger({ myCustomOption: value }); This way they wouldn't have to modify any of the code inside the Logger service. It's not a huge deal to me if we add this capability or not. However, I just wanted to make sure my point was clear. |
@mleanos I get what you mean but externally calling See what I mean? Do you think it's still worth to chase this change or just clean out the extra options for now? |
I didn't mean that it would be called externally. Someone could pass options directly on this exact line in the logger file, instead of passing an empty object: Line 144 in c8cbcd3
I'm ok with just having you clean it up. As it's not a critical issue to me. |
@mleanos I'm not trying to run around the tree, I value your feedback, but my thinking is that this kind of change that someone will make will cause them conflicts in future syncs with the project so it's probably one of the framework setups that people usually tend not to change. Let's clean it up first and can further refactor after 0.5.0, you're most welcome to also propose the change :) |
I agree. This isn't a big deal to me, just thought it would be a convenience. However, any persistent settings can just be added to the default env config. So in the end, I don't see this very useful either. I guess I just figured that since the |
Cool, thanks for futher confirming 👍 |
Hi there,
Suggesting removal of an unused paramater in mean/config/lib/logger.js
Down in the function
logger.setupFileLogger = function setupFileLogger(options) {
Notice the function parameter
options
?Very minor issue, essentially just a tidy-up.
What does everyone think?
The text was updated successfully, but these errors were encountered: