Skip to content
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(server): don't output all log messages #1232

Merged
merged 2 commits into from
Nov 29, 2022
Merged

fix(server): don't output all log messages #1232

merged 2 commits into from
Nov 29, 2022

Conversation

fortuna
Copy link
Collaborator

@fortuna fortuna commented Nov 24, 2022

This is polluting the log output. I need to fix this asap.

@fortuna fortuna changed the title Don't output all log messages fix(server): don't output all log messages Nov 24, 2022
Copy link
Contributor

@jyyi1 jyyi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@daniellacosse daniellacosse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some thoughts

src/shadowbox/infrastructure/logging.ts Outdated Show resolved Hide resolved
export function error(message: string) {
console.error(makeLogMessage('E', getCallsite(), message));
if (LogLevel.ERROR <= maxMsgLevel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another nit but personally i would short circuit on the inverse so the function main has a body. rn this reads "only do something if you're in the correct log level" rather than the inverse "do something unless you're not"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it more readable to see the condition for which the code applies. I'd agree with you if there were multiple conditions to escape, to avoid nesting.

Copy link
Contributor

@daniellacosse daniellacosse Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, i agree this is rather subjective. just think that a function should do something by default, if you call it.

@fortuna fortuna merged commit 1368090 into master Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants