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

feat: Move all logs everything over to logger #830

Merged
merged 6 commits into from
Oct 11, 2023

Conversation

benjackwhite
Copy link
Collaborator

@benjackwhite benjackwhite commented Oct 10, 2023

Changes

We've had a few issues with over-logging. These show up in recordings and are unclear who they belong to as we don't prefix, as well as generally being a lot noisier than people like.

  • Everything now goes via logger
  • console.log is no longer allowed via eslint
  • Only critical logs are always logged
  • Otherwise debug need to be enabled or a new window value POSTHOG_DEBUG to be present (helps us enable debugging on people's sites where posthog is not available in the global context

Checklist

@github-actions
Copy link

github-actions bot commented Oct 10, 2023

Size Change: -2.3 kB (0%)

Total Size: 724 kB

Filename Size Change
dist/array.full.js 177 kB -554 B (0%)
dist/array.js 118 kB -584 B (0%)
dist/es.js 118 kB -581 B (0%)
dist/module.js 118 kB -581 B (0%)
ℹ️ View Unchanged
Filename Size
dist/recorder-v2.js 95 kB
dist/recorder.js 58.3 kB
dist/surveys.js 39.4 kB

compressed-size-action

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

LGTM

src/__tests__/decide.js Outdated Show resolved Hide resolved
@benjackwhite benjackwhite added the bump patch Bump patch version when this PR gets merged label Oct 11, 2023
@benjackwhite benjackwhite merged commit 00a6a4a into master Oct 11, 2023
13 checks passed
@benjackwhite benjackwhite deleted the feat/better-logging branch October 11, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants