Skip to content

Commit

Permalink
#196: debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Espen Norderud committed Oct 24, 2023
1 parent 79021a0 commit 1736ca0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/agenda/AgendaLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import type { IEvent, IPerformance } from '../../model/event';
import { Submission } from '../../enums/submission-type';
import type { Cv } from '$lib/types/cv';
import {featureIsToggledOn} from "../../featureFlagging/common";
export let submission: ISubmission;
export let event: IEvent;
Expand All @@ -22,6 +23,10 @@
};
const authorsLength = submission?.authors?.length || 0;
if (featureIsToggledOn("debuglog")) {
console.log({submission, event, performance, cvs, authorsLength});
}
</script>

<div class="container-fluid">
Expand Down
5 changes: 4 additions & 1 deletion src/featureFlagging/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ import {parseFlag} from "./common";
*/
export interface FrontendFeatureToggles {
performances: boolean
debuglog: boolean
};
export type FrontendFeatureToggleName = keyof FrontendFeatureToggles;

export const flags: FrontendFeatureToggles = {
performances: false
performances: false,
debuglog: false
}


export const toggleByURIParams = (searchParams: URLSearchParams) => {
flags.performances = parseFlag(searchParams.get("performances"));
flags.debuglog = parseFlag(searchParams.get("debuglog"));
}

0 comments on commit 1736ca0

Please sign in to comment.