Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Changes to remove empty fields being sent in logs (#10778)
Browse files Browse the repository at this point in the history
* Changes to hide extra fields in client logging

* Removed empty fields from logs.
  • Loading branch information
hanzlamateen authored Jul 31, 2024
1 parent 33d3599 commit 539ab6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ const ProfileMenu = ({ hideLogin, onClose, isPopover }: Props): JSX.Element => {
.then(() => {
selfUser.acceptedTOS.set(true)
logger.info({
event_name: 'accept_tos',
event_value: ''
event_name: 'accept_tos'
})
})
.catch((e) => {
Expand Down Expand Up @@ -183,7 +182,7 @@ const ProfileMenu = ({ hideLogin, onClose, isPopover }: Props): JSX.Element => {
}, [selfUser.name.value])

useEffect(() => {
if (!loading.value) logger.info({ event_name: 'view_profile', event_value: '' })
if (!loading.value) logger.info({ event_name: 'view_profile' })
}, [loading.value])

useEffect(() => {
Expand Down Expand Up @@ -234,8 +233,7 @@ const ProfileMenu = ({ hideLogin, onClose, isPopover }: Props): JSX.Element => {
// @ts-ignore
AvatarService.updateUsername(userId, name).then(() =>
logger.info({
event_name: 'rename_user',
event_value: ''
event_name: 'rename_user'
})
)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/client-core/src/world/Location.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const LocationPage = ({ online }: Props) => {
useLoadEngineWithScene()

useEffect(() => {
if (ready.value) logger.info({ event_name: 'enter_location', event_value: '' })
return () => logger.info({ event_name: 'exit_location', event_value: '' })
if (ready.value) logger.info({ event_name: 'enter_location' })
return () => logger.info({ event_name: 'exit_location' })
}, [ready.value])

return (
Expand Down
7 changes: 1 addition & 6 deletions packages/server-core/src/ServerLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,7 @@ export const logger = pino(
}

const defaultPairs = {
component: 'server-core',
event_name: '',
event_value: '',
userId: '',
location_id: '',
project_id: ''
component: 'server-core'
}
const defaultProperties = Object.keys(defaultPairs)

Expand Down

0 comments on commit 539ab6e

Please sign in to comment.