-
Notifications
You must be signed in to change notification settings - Fork 1
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
add logger #446
add logger #446
Conversation
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.
- there are still two instances of console.log in /handlers/options.ts
- the tests pass but somehow errors related to the harts ratio are returned:
benedikt@LAPTOP-51EETM3E:~/forum-backend$ pnpm test src/services/questions.spec.ts
[email protected] test /home/benedikt/forum-backend
jest --runInBand "src/services/questions.spec.ts"
PASS src/services/questions.spec.ts
service: forumQuestions
✓ calculates available hearts correctly (2 ms)
✓ error if max ratio was not calculated correctly
✓ returns custom hearts if customHearts is set
✓ executes the function if customHearts is not set
✓ executes the function if customHearts is set to less than 2
✓ that function returns 0 in case the number of proposals are less than 2
Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 2.474 s
Ran all test suites matching /src\/services\/questions.spec.ts/i.
[10:03:30.311] ERROR (10674): baseNumerator/baseDenominator does not equal the specified max ratio
[10:03:30.313] ERROR (10674): Number of proposals must be at least 2
- in services/question.ts question_options should be changed to options in the raw sql query.
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.
remove unused dependency: import { logger } from '../utils/logger'; from services/votes
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.
lgtm now
* add pino * replace console with logger * fix conflicts * update errors * remove unused import
overview
adds a pino logger, this is a very lightweight one.
there are levels of logs shown in the comment, by default it is put to info which means it includes that and everything before that level.
for example to see less you can run:
for tests to see logs you can run