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

247 level based logging #375

Closed
wants to merge 4 commits into from
Closed

247 level based logging #375

wants to merge 4 commits into from

Conversation

FragAverage
Copy link
Contributor


Issue #247 | Logging

Discord Username: @FragAverage

What type of PR is this? (select all that apply)

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

Start of a level based logging system to ensure informational/development logs do not make it to production, and in future error and crititcal logs can be stored or parsed to another system.

Related Tickets & Documents

Added/updated tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

@@ -0,0 +1,3 @@
export class Constants {
public static readonly InDev = process.env.NODE_ENV === "development";
Copy link
Owner

@webdevcody webdevcody Jul 17, 2023

Choose a reason for hiding this comment

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

instead of checking if NODE_ENV === 'development', I'd suggest allowing us to manually configure LOG_LEVEL='warn'|'error'|'info'. This allows us to dynamically change the levels on the API side of things simply by changing the env variable. You can default it to 'INFO' in our .env.sample

Additionally, if this is a server only logger, please put import 'server-only' at the top, if you plan to allow this logger to also be used in the client, we'll need a NEXT_PUBLIC_LOG_LEVEL variable in the front end.

@sudo-adduser-jordan
Copy link
Contributor

My bad leaving those console logs there. They have beeen clean up.

@sudo-adduser-jordan
Copy link
Contributor

sudo-adduser-jordan commented Jul 18, 2023

I dont't believe we need a logger for race.tsx as we already have a console.table for the /race directory.

@webdevcody
Copy link
Owner

I'm going to consider thie PR as stale. Feel free to remake it in the future @FragAverage

@webdevcody webdevcody closed this Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants