-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix #6179 Initializing default logger #6186
Conversation
Fixes: #6179 Removes unnessary logs
src/logger.js
Outdated
|
||
export function setLogger(aLogger) { | ||
logger = aLogger; | ||
} | ||
|
||
export function getLogger() { | ||
if (!logger) { | ||
return defaultLogger(); |
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 you just want to instantiate the default logger once instead of instantiating a new instance for earch get logger call?
i.e.
if (!logger) {
logger = defaultLogger();
}
return logger;
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 just noticed that
once you remove the log calls from the adapters, is the change in logger.js necessary? not clear to me what the change in logger.js is doing, or how it addresses the issue. |
Codecov Report
@@ Coverage Diff @@
## master #6186 +/- ##
===========================================
+ Coverage 83.42% 93.81% +10.38%
===========================================
Files 167 167
Lines 11298 11293 -5
===========================================
+ Hits 9425 10594 +1169
+ Misses 1873 699 -1174
Continue to review full report at Codecov.
|
@acinader This one will need some work. If want to reproduce it see my #6179 (comment) At least we should allow the configurations to be set before crashing. That way silencing the logs can be done. If you can think of a better fix in the meantime let me know. |
@acinader I think this is good to go. If there is an error with winston just use console transport. |
so even without the logging in the adapters, this still throws? is there a legitimate case where we could now be 'swallowing' an error? i.e. you want to supress the error when the logger is first referenced, but you will also supress an legitimate error. is there any way to defer instantiating the logger instead? |
@acinader I added a commit with a fix. It no longer throws an error and will use the console as backup. |
yes, I see the current diff. I don't see where you're adding the console, or how that'll work. |
Its already in there right after the try catch |
@kevflynn Can you see if this fixes your issue? |
…#6186) * Fix parse-community#6179 Initializing default logger Fixes: parse-community#6179 Removes unnessary logs * fix typo * if error just write to console
Fixes: #6179
Removes unnessary logs.
@kevflynn This PR will allow you to run Parse Server with your configs.