chore(svelte): Remove stub logger (#63342)

We've recently added v2 telemetry support and should not use the stub
logger anymore.

## Test plan

Code inspection.
This commit is contained in:
Felix Kling 2024-06-19 15:54:31 +02:00 committed by GitHub
parent 61d8033a4b
commit ec3b6b14a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 21 deletions

View File

@ -1,2 +1 @@
PUBLIC_DOTCOM=
PUBLIC_ENABLE_EVENT_LOGGER=

View File

@ -1,18 +0,0 @@
// We want to limit the number of imported modules as much as possible
import { onMount } from 'svelte'
import { PUBLIC_ENABLE_EVENT_LOGGER } from '$env/static/public'
/**
* Can only be called during component initialization. It logs a view event when
* the component is mounted (and event logging is enabled).
*/
export function logViewEvent(eventName: string, eventProperties?: any, publicArgument?: any): void {
if (PUBLIC_ENABLE_EVENT_LOGGER) {
onMount(() => {
// TODO: Implement event logging
console.log('logViewEvent', eventName, eventProperties, publicArgument)
})
}
}

View File

@ -1,11 +1,15 @@
<script lang="ts">
import { onMount } from 'svelte'
import HeroPage from '$lib/HeroPage.svelte'
import { logViewEvent } from '$lib/logger'
import { TELEMETRY_RECORDER } from '$lib/telemetry'
export let repoName: string
export let viewerCanAdminister: boolean
logViewEvent('RepositoryError')
onMount(() => {
TELEMETRY_RECORDER.recordEvent('repo.error.notFound', 'view')
})
</script>
<HeroPage title="Repository not found" icon={ILucideBookX}>